/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * com_distri_compras_detalle.java
 *
 * Created on 25/08/2011, 06:45:23 PM
 */

package sie_invdis;


import java.awt.print.PrinterException;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
import javax.swing.table.DefaultTableCellRenderer;

import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;
/**
 *
 * @author Michelle
 */
public class com_distri_compras_detalle extends javax.swing.JFrame {


    private javax.swing.table.DefaultTableModel jtable_modelo_detalle;
    private javax.swing.table.DefaultTableModel jtable_modelo_detalled;
    private javax.swing.table.DefaultTableModel jtable_modelo_distribucion;
    private javax.swing.table.DefaultTableModel jtable_modelo_fotos;
    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_detalle_exp;
     private javax.swing.table.DefaultTableModel jtable_modelo_existencias;

      private DefaultListModel modelo ;
      
    private javax.swing.table.DefaultTableModel jtable_modelo_estadisticas;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    private java.util.Date fechahoy=new Date();
    bd_conexion x = new bd_conexion() ;
    ResultSet rs = null;
        DefaultTableCellRenderer alinearCentro, alinearderecha, alinearIzquierda;

    private int indexactual=0,yacarguedistrialma=0,yacarguedistrifotos=0,yacarguedistrirecepciones=0,columnavisualisa=0,columnavisualisa2=0,columnavisualisa3=0,yacarguestock=0,controltiendas=0;


    /** Creates new form com_distri_compras_detalle */
    public com_distri_compras_detalle() {
    this.iniciar_modelo_de_tabla();
        initComponents();
    }
    public com_distri_compras_detalle(String idfol) {
    this.iniciar_modelo_de_tabla();
    this.iniciar_modelo_distribucionalma();
    this.iniciar_modelo_distrifotos();
    this.iniciar_modelo_recpeciones();
    this.iniciar_modelo_detalleexp();
    this.iniciar_modelo_artiexistencias();
    this.iniciar_modelo_articuloestadistica();
    this.iniciar_modelo_de_tablad();
    initComponents();

       // jt_detallecompra.getTableHeader().setPreferredSize(new Dimension(jt_detallecompra.getTableHeader().getWidth(),50));
       // jtbl_distribucion.getTableHeader().setPreferredSize(new Dimension(jtbl_distribucion.getTableHeader().getWidth(),50));

        jt_detallecompra.getColumnModel().getColumn(0).setPreferredWidth(55);//Codigo
        jt_detallecompra.getColumnModel().getColumn(1).setPreferredWidth(120);//Descripcion
        jt_detallecompra.getColumnModel().getColumn(2).setPreferredWidth(60);//control almacen
        jt_detallecompra.getColumnModel().getColumn(3).setPreferredWidth(40);//Item
        jt_detallecompra.getColumnModel().getColumn(4).setPreferredWidth(5);//unidad E.
        jt_detallecompra.getColumnModel().getColumn(5).setPreferredWidth(5);//factor
        jt_detallecompra.getColumnModel().getColumn(6).setPreferredWidth(5);//Unidad Salida
        jt_detallecompra.getColumnModel().getColumn(7).setPreferredWidth(10);//Pz entrada
        jt_detallecompra.getColumnModel().getColumn(8).setPreferredWidth(10);//costo.
        jt_detallecompra.getColumnModel().getColumn(9).setPreferredWidth(5);//%desc
        jt_detallecompra.getColumnModel().getColumn(10).setPreferredWidth(5);//%impuesto
        jt_detallecompra.getColumnModel().getColumn(11).setPreferredWidth(20);//importe costo entrada
        jt_detallecompra.getColumnModel().getColumn(12).setPreferredWidth(5);//pz salida
        jt_detallecompra.getColumnModel().getColumn(13).setPreferredWidth(5);//costo sal
        jt_detallecompra.getColumnModel().getColumn(14).setPreferredWidth(20);//importe costo sal
        jt_detallecompra.getColumnModel().getColumn(15).setPreferredWidth(5);//importe costo sal

        jtbl_distribucion.getColumnModel().getColumn(0).setPreferredWidth(60);//Codigo
        jtbl_distribucion.getColumnModel().getColumn(1).setPreferredWidth(60);//Codigo

        jtbl_distribucionfotos.getColumnModel().getColumn(0).setPreferredWidth(60);//Codigo
        jtbl_distribucionfotos.getColumnModel().getColumn(1).setPreferredWidth(150);//Descripcion
        jtbl_distribucionfotos.getColumnModel().getColumn(2).setPreferredWidth(60);//Item
        jtbl_distribucionfotos.getColumnModel().getColumn(3).setPreferredWidth(10);//Un. entrada
        jtbl_distribucionfotos.getColumnModel().getColumn(4).setPreferredWidth(200);//Factor

        this.carga_datos_encabezado(10, idfol);
        this.carga_datos_detalle(idfol);
        this.buttonGroup1.setSelected(jrbtn_columnaclave.getModel(), true);
        this.buttonGroup2.setSelected(jrbtn_columnaclave1.getModel(), true);
        this.buttonGroup3.setSelected(jrbtn_columnaclave2.getModel(), true);

        jt_detallecompra1.getColumnModel().getColumn(0).setPreferredWidth(55);//Codigo
        jt_detallecompra1.getColumnModel().getColumn(1).setPreferredWidth(120);//Descripcion
        jt_detallecompra1.getColumnModel().getColumn(2).setPreferredWidth(60);//control almacen
        jt_detallecompra1.getColumnModel().getColumn(3).setPreferredWidth(40);//Item
        jt_detallecompra1.getColumnModel().getColumn(4).setPreferredWidth(5);//unidad E.
        jt_detallecompra1.getColumnModel().getColumn(5).setPreferredWidth(5);//factor
        jt_detallecompra1.getColumnModel().getColumn(6).setPreferredWidth(5);//Unidad Salida
        jt_detallecompra1.getColumnModel().getColumn(7).setPreferredWidth(10);//Pz entrada
        jt_detallecompra1.getColumnModel().getColumn(8).setPreferredWidth(10);//costo.
        jt_detallecompra1.getColumnModel().getColumn(9).setPreferredWidth(5);//%desc
        jt_detallecompra1.getColumnModel().getColumn(10).setPreferredWidth(5);//%impuesto
        jt_detallecompra1.getColumnModel().getColumn(11).setPreferredWidth(20);//importe costo entrada
        jt_detallecompra1.getColumnModel().getColumn(12).setPreferredWidth(5);//pz salida
        jt_detallecompra1.getColumnModel().getColumn(13).setPreferredWidth(5);//costo sal
        jt_detallecompra1.getColumnModel().getColumn(14).setPreferredWidth(20);//importe costo sal
        jt_detallecompra1.getColumnModel().getColumn(15).setPreferredWidth(5);//importe costo sal

        this.jbtn_generarventa1.setVisible(false);
        this.jbtn_actualizar1.setVisible(false);
        //this.jbtn_actualizar2.setVisible(false);
        
    }

private void iniciar_modelo_de_tabla()
    {
        jtable_modelo_detalle=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalle.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>ctrol. A.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Item</b></html>");
        
        jtable_modelo_detalle.addColumn("<html><b>U.E.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Fac.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>U.S.</b></html>");

        jtable_modelo_detalle.addColumn("<html><b>Pz E.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>C. Ent</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>%Des</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>%imp</b></html>");

       
        jtable_modelo_detalle.addColumn("<html><b>Imp.C. E.</b></html>");

        jtable_modelo_detalle.addColumn("<html><b>Pz Sal.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>C. Sal.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>Imp.C. S.</b></html>");
        jtable_modelo_detalle.addColumn("<html><b>D</b></html>");
   }
private void iniciar_modelo_de_tablad()
    {
        jtable_modelo_detalled=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalled.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>ctrol. A.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>Item</b></html>");

        jtable_modelo_detalled.addColumn("<html><b>U.E.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>Fac.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>U.S.</b></html>");

        jtable_modelo_detalled.addColumn("<html><b>Pz E.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>C. Ent</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>%Des</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>%imp</b></html>");


        jtable_modelo_detalled.addColumn("<html><b>Imp.C. E.</b></html>");

        jtable_modelo_detalled.addColumn("<html><b>Pz Sal.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>C. Sal.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>Imp.C. S.</b></html>");
        jtable_modelo_detalled.addColumn("<html><b>D</b></html>");
   }
private void iniciar_modelo_detalleexp()
    {
        jtable_modelo_detalle_exp=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalle_exp.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_detalle_exp.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_detalle_exp.addColumn("<html><b>Item</b></html>");
        jtable_modelo_detalle_exp.addColumn("<html><b>Pz Ent.</b></html>");
        jtable_modelo_detalle_exp.addColumn("<html><b>Costo ent.</b></html>");
        jtable_modelo_detalle_exp.addColumn("<html><b>Precio Michelle</b></html>");
   }

private void iniciar_modelo_distrifotos()
    {
        jtable_modelo_fotos=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_fotos.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Item</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_fotos.addColumn("<html><b>Foto</b></html>");
   }
private void iniciar_modelo_recpeciones()
    {

        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Folio</b></html>");
        jtable_modelo.addColumn("<html><b>Status</b></html>");
        jtable_modelo.addColumn("<html><b>Cliente</b></html>");
        jtable_modelo.addColumn("<html><b>Doc. Ant.</b></html>");
        jtable_modelo.addColumn("<html><b>Fecha</b></html>");
        jtable_modelo.addColumn("<html><b>F.llega Tienda</b></html>");
        jtable_modelo.addColumn("<html><b>F.Recepcion</b></html>");
        jtable_modelo.addColumn("<html><b>Dias Trans.</b></html>");
        jtable_modelo.addColumn("<html><b>Guia Env.</b></html>");
        jtable_modelo.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo.addColumn("<html><b>Costo</b></html>");
        jtable_modelo.addColumn("<html><b>Observaciones</b></html>");


   }

private void iniciar_modelo_distribucionalma()
    {
     modelo = new javax.swing.DefaultListModel();
        jtable_modelo_distribucion=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_distribucion.addColumn("Codigo");
        jtable_modelo_distribucion.addColumn("Item");
        jtable_modelo_distribucion.addColumn("Costo");
        jtable_modelo_distribucion.addColumn("P.Michelle");
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_distribucion_clientes() as (id smallint,idcleinte character varying(12),ordenvisua smallint,clientenombre character varying(60));",variables_global.getconexiongral());
               while (rs.next())
                    {
                          jtable_modelo_distribucion.addColumn("<html><b>"+rs.getString("idcleinte")+":"+rs.getString("clientenombre")+"</b></html>");
                          modelo.addElement(rs.getString("idcleinte")+":"+rs.getString("clientenombre"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        jtable_modelo_distribucion.addColumn("Total");
    }
private void iniciar_modelo_artiexistencias()
    {
        jtable_modelo_existencias=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_existencias.addColumn("Clave");
        jtable_modelo_existencias.addColumn("Descripcion.");
        jtable_modelo_existencias.addColumn("Item");
       //se crea intancia de la clase conexion
    }
private void iniciar_modelo_tiendasexis()
    {
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas() as (tie_descri character varying(35),tie_id integer,tie_desesque character varying(25),idclie character varying(12));",variables_global.getconexiongral());
               while (rs.next())
                    {
                      jtable_modelo_existencias.addColumn("<html><b>"+rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idclie")+"</b></html>");
                    }
               controltiendas=1;
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }
private void iniciar_modelo_articuloestadistica()
 {
        jtable_modelo_estadisticas=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>C.Surt</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Pzas E.</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>P.Vend</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>f.P.Venta</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>f.U.Venta</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>E.Min</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>E.max</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Exist.</b></BODY></html>");

}


private void carga_datos_encabezado(int opbus,String tbusca)
    {
       String fechacat = "",fechallegatienda="",fechaentrega="";
       DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
       String texto="select * from x1distribucion_terminados_compras_catalogov3("+opbus+",'"+tbusca+"') as (idreg integer,iddocumento character varying(12),idstatus smallint,statusdescribe character varying(15),doctoanterior character varying(12),fechadocto date,fechadoctoenmes text,idproveedor character varying(12),describeproveedor character varying(60),observadocto character varying(80),usuario character varying(20),impuestoporcen numeric,descuentototal numeric,clasificacion smallint,describeclasificacion character varying(30),clasifechainicio date,clasifechafin date,clavepersonaldoc character varying(45),docsiguiente character varying(12),fechaentrega date,fechavenci date,impuestoporcen2 numeric,descuentofinan numeric,piezas numeric,totalimporte numeric,totalprecio numeric,idsubfam smallint,diasenalmacen integer,diasproveealmacen integer,hora time,etimal integer,etinoe integer,eticosto numeric,pzg numeric,totdesg numeric,totimpg numeric,totalg numeric,totalvg numeric,flete numeric,subtotalg numeric,docto_blister text,costo_blister numeric);";

        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                 this.tf_status.setText(rs.getString("idstatus")+":"+rs.getString ("statusdescribe"));
                 this.tf_foliodistribucion.setText(rs.getString("iddocumento"));
                 this.tf_foliodoctoanterior.setText(rs.getString ("doctoanterior"));
                 this.tf_foliodoctoanteriorupda.setText(rs.getString ("doctoanterior"));
                 this.tf_fecha.setText(this.fechaeuropea(rs.getString("fechadocto"))+":"+DiaSemana(this.fechaeuropea(rs.getString("fechadocto"))));
                 if(rs.getString("fechaentrega") != null)
                        {
                           fechallegatienda=this.fechaeuropea(rs.getString("fechaentrega"));
                        }
                 this.tf_fechareferencia.setText(fechallegatienda);
                 if(rs.getString("fechavenci") != null )
                        {
                            fechaentrega=""+this.fechaeuropea(rs.getString ("fechavenci"))+":"+this.DiaSemana(rs.getString("fechavenci"))+"";
                        }
                 this.tf_fecharecepcion.setText(fechaentrega);
                 this.jtf_viaje.setText(rs.getString ("clasificacion")+":"+rs.getString ("describeclasificacion"));
                 this.jtf_idproveedor.setText(rs.getString ("idproveedor")+":"+rs.getString ("describeproveedor"));
                 this.jtf_totalpiezas.setText(miformat.format(rs.getFloat("piezas")));
                 //this.jtf_importe.setText(miformat.format(rs.getFloat("totalimporte")));
                 this.jtf_importeprecio.setText(miformat.format(rs.getFloat("totalprecio")));

                 this.jep_observaciones.setText(rs.getString ("observadocto"));
                 this.jtf_observa_update.setText(rs.getString ("observadocto"));
                 this.jtf_flete.setText(miformat.format(rs.getFloat("flete")));
                 this.jtf_doctoblister.setText(rs.getString ("docto_blister"));
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }

private void carga_datos_detalle(String tbusca)
    {

       DecimalFormat miformat = new DecimalFormat("############.#####");
       DecimalFormat miformatde = new DecimalFormat("############.#####");

       Object[] fnewRow = new Object[16];
       Object[] fnewRowd = new Object[this.jtable_modelo_distribucion.getColumnCount()];
       Object[] fnewRowf = new Object[5];
       Object[] fnewRowexp = new Object[6];
       Object[] fnewRowe = new Object[3];
        while(jtable_modelo_detalle.getRowCount()>0)jtable_modelo_detalle.removeRow(0);
       while(jtable_modelo_detalled.getRowCount()>0)jtable_modelo_detalled.removeRow(0);
       while(jtable_modelo_distribucion.getRowCount()>0)jtable_modelo_distribucion.removeRow(0);
       while(jtable_modelo_fotos.getRowCount()>0)jtable_modelo_fotos.removeRow(0);
       while(jtable_modelo_detalle_exp.getRowCount()>0)jtable_modelo_detalle_exp.removeRow(0);
       while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
       //invoco al metodo que trae el recordset de datos
       String texto ="select * from x1distribucion_terminados_compras_detalle(1,'"+tbusca+"') as (idreg integer,iddocto character varying(12),idarti character varying(16),can_articuloent numeric,factor numeric,cant_articulosal numeric,costoent numeric,costosal numeric,descuento1 numeric,descuento2 numeric,impuesto1 numeric,impuesto2 numeric,politicadescuento smallint,tipocambio numeric,obserparti character varying(60),idartisubmodelo character varying(4),artidescrip character varying(80),unidadsal character varying(3),precio1 numeric,descorta character varying(20),unidadentrada character varying(3),controla character varying(20),itemprovee character varying(20),precio5 numeric,dif numeric,costoi numeric);";
        System.out.println(texto);

        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    fnewRow[0]=rs.getString ("idarti");
                    fnewRow[1]=rs.getString ("artidescrip");
                    fnewRow[2]=rs.getString ("itemprovee");
                    fnewRow[3]=rs.getString ("controla");
                    fnewRow[4]=rs.getString ("unidadentrada");
                    fnewRow[5]=rs.getString ("factor");
                    fnewRow[6]=rs.getString ("unidadsal");

                    fnewRow[7]=miformat.format(rs.getFloat("can_articuloent"));
                    fnewRow[8]=miformatde.format(rs.getFloat("costoent"));
                    fnewRow[9]=miformatde.format(rs.getFloat("descuento1"));
                    fnewRow[10]=miformatde.format(rs.getFloat("Impuesto1"));
                    fnewRow[11]=miformatde.format(rs.getFloat("can_articuloent")*rs.getFloat("costoent"));

                    fnewRow[12]=miformat.format(rs.getFloat("cant_articulosal"));
                    fnewRow[13]=miformatde.format(rs.getFloat("costosal"));
                    fnewRow[14]=miformatde.format(rs.getFloat("cant_articulosal")*rs.getFloat("costosal"));
                    fnewRow[15]=miformatde.format(rs.getFloat("dif"));
                    jtable_modelo_detalle.addRow(fnewRow);
                    if(rs.getFloat("dif")!=0)
                        {
                        fnewRow[7]=miformat.format(rs.getFloat("dif"));
                        fnewRow[12]=miformat.format(rs.getFloat("dif"));
                        jtable_modelo_detalled.addRow(fnewRow);
                        }
                    fnewRowd[0]=rs.getString ("idarti");
                    fnewRowd[1]=rs.getString ("itemprovee");
                    fnewRowd[2]=miformatde.format(rs.getFloat("costosal"));
                    fnewRowd[3]="<html><b>"+miformat.format(rs.getFloat("precio5"))+"</b></html>";
                    jtable_modelo_distribucion.addRow(fnewRowd);
                    fnewRowf[0]=rs.getString("idarti");
                    fnewRowf[1]=rs.getString("artidescrip");
                    fnewRowf[2]=rs.getString("itemprovee");
                    fnewRowf[3]="<html><b>"+miformat.format(rs.getFloat("precio5"))+"</b></html>";
                    fnewRowf[4]="";
                    jtable_modelo_fotos.addRow(fnewRowf);
                    fnewRowexp[0]=rs.getString("idarti");
                    fnewRowexp[1]=rs.getString("artidescrip");
                    fnewRowexp[2]=rs.getString("itemprovee");
                    fnewRowexp[3]=miformat.format(rs.getFloat("cant_articulosal"));
                    fnewRowexp[4]=miformatde.format(rs.getFloat("costosal"));
                    fnewRowexp[5]=miformat.format(rs.getFloat("precio5"));

                    jtable_modelo_detalle_exp.addRow(fnewRowexp);

                  fnewRowe[0]=rs.getString("idarti");
                  fnewRowe[1]=rs.getString ("artidescrip");
                  fnewRowe[2]=rs.getString("itemprovee")+".";
                  jtable_modelo_existencias.addRow(fnewRowe);

                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        this.distribucionmaraencero();
        this.calcularimportes();
        this.calcularimportesd();
      }


private void carga_articulo_estadisticas(String idtienda,String idpro)
    {
            DecimalFormat miformat = new DecimalFormat("###,###,###,###");
            while(jtable_modelo_estadisticas.getRowCount()>0)jtable_modelo_estadisticas.removeRow(0);
            Object[] fnewRow = new Object[10];
            int diasdif=0,diasdifprimer=0,diasdifultimo=0;
            float totalexist=0;
            String idcadena[]=null;
            String texto2="select * from x1sieuno_articulo_ventas_estadisticasv3(0,"+idtienda+",'"+idpro+"') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,acumventas real,primerv date,ultimav date,nmovent bigint,piezasent real,diasvsprimerventa integer,diasvsultimaventa integer,diasenvenderse integer)";
            java.util.Date fechaactual=new Date();
            try
                {
                 rs = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                          while (rs.next())
                            {
                                    idcadena=rs.getString("clavepro").toString().split(":");
                                    diasdif=0;
                                    diasdifprimer=0;
                                    diasdifultimo=0;
                                    fnewRow[0]=idcadena[2]+":"+idcadena[1];
                                    fnewRow[1]=miformat.format(rs.getFloat("nmovent"));
                                    fnewRow[2]=miformat.format(rs.getFloat("piezasent"));
                                    fnewRow[3]=miformat.format(rs.getFloat("acumventas")*-1);
                                    if(rs.getString("primerv") != null)
                                        {
                                            //diasdifprimer=this.fechasDiferenciaEnDias(this.fechadecadenaadate(rs.getString("primerv")),fechaactual);
                                            fnewRow[4]="<html>"+this.fechaeuropea(rs.getString("primerv"))+"<br>"+this.mensajetiempo(rs.getInt("diasvsprimerventa"))+"</html>";
                                            //diasdif=this.fechasDiferenciaEnDias(this.fechadecadenaadate(rs.getString("primerv")),this.fechadecadenaadate(rs.getString("ultimav")));

                                        }
                                    else
                                        {
                                            fnewRow[4]="";

                                        }
                                    if(rs.getString("ultimav") != null)
                                        {
                                            //diasdifultimo=this.fechasDiferenciaEnDias(this.fechadecadenaadate(rs.getString("ultimav")),fechaactual);

                                            if(rs.getFloat("exi")<=0)
                                                {
                                                fnewRow[5]="<html><font color=\"red\">"+this.fechaeuropea(rs.getString("ultimav"))+"<br>Agotado"+this.mensajetiempo(rs.getInt("diasvsultimaventa"))+"</font></html>";
                                                    //fnewRow[12]="<html><font color=\"red\">"+"Agotado"+this.mensajetiempo(diasdifultimo)+"</font></html>";
                                                }
                                            else
                                                {
                                                fnewRow[5]="<html>"+this.fechaeuropea(rs.getString("ultimav"))+"<br>"+this.mensajetiempo(rs.getInt("diasvsultimaventa"))+"</html>";
                                                }
                                        }
                                    else
                                        {
                                            fnewRow[5]="";
                                        }
                                    this.jtf_fotoidstocks2.setText(miformat.format(rs.getFloat("preve")));

                                    fnewRow[6]=miformat.format(rs.getFloat("min"));
                                    fnewRow[7]=miformat.format(rs.getFloat("max"));
                                    fnewRow[8]=miformat.format(rs.getFloat("exi"));
                                    totalexist+=rs.getFloat("exi");
                                    jtable_modelo_estadisticas.addRow(fnewRow);
                            }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }


}

 private String mensajetiempo(int nd) {
     String mensaje="";
     if (nd==0)
				{
					mensaje=" Hoy ";
				}
		if (nd==1)
				{
					mensaje=" ayer ";
				}
		if (nd>1)
				{
					mensaje=" Hace " + nd + " Dias " ;
				}
     if (nd<0)
				{
					mensaje=" Vence En " + nd + " Dias " ;
				}
 	return mensaje;
 }

private int findcolumna_idtienda (String titulo)  {
  int columnas = jtable_modelo_distribucion.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_distribucion.getColumnName(j).replace("<html><b>","").split(":");
                     System.out.println("Busqueda:"+columtitulo[0]+" "+titulo);
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo[0]+" "+columencontrado);
                        }
                }
    return columencontrado;
}

private void crea_hoja_distribucionalmacen(String codigo,String cantidad,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("#########.##");
        int numerofilas=this.jtable_modelo_distribucion.getRowCount();
        String idstat="";
        int numerocolumnas=this.jtable_modelo_distribucion.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(cantidad);
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo_distribucion.getValueAt(ii, 0).toString();
                    
                    if (idstat.equals(codigo))
                        {
                            System.out.println("Agregando:"+cantidad+" "+codigo);
                            encontrado=1;
                            jtable_modelo_distribucion.setValueAt(miformat.format(cantifam),ii ,columna);
                        }
                }
       //if(encontrado==0)
         //   {
         //   fnewRow[0]=mes;
         //   for( ii=1;ii<numerocolumnas;ii++)
         //       {
         //                      System.out.println(mes);
         //                      if(ii==columna)
         //                           {
         //                               fnewRow[ii]=miformat.format(cantifam);
         //                           }
         //                      else
         //                           {
         //                               fnewRow[ii]="0";
         //                           }
         //       }
         //    jtable_modelo_distribucion.addRow(fnewRow);
         //  }
    }
private void crea_hoja_compraindi(int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        String idstat="",ca="0",codigo="";

        int ii=0,encontrado=0,jj=0;
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos

        for( ii=0;ii<this.jtable_modelo_distribucion.getRowCount();ii++)
                {
                    if(jtable_modelo_distribucion.getValueAt(ii, 0).toString().length()>0)
                    {
                        idstat=jtable_modelo_distribucion.getValueAt(ii, 0).toString();
                        ca=jtable_modelo_distribucion.getValueAt(ii, columna).toString();
                        for( jj=0;jj<this.jtable_modelo_detalle.getRowCount();jj++)
                            {
                                codigo=jtable_modelo_detalle.getValueAt(jj, 0).toString();
                                if (idstat.equals(codigo))
                                    {
                                        jtable_modelo_detalle.setValueAt(ca,jj,7);
                                        jtable_modelo_detalle.setValueAt(ca,jj,12);
                                    }
                            }
                    }
                }
        this.calcularimportes();
    }
private void crea_hoja_distribucionaclientes(String codigo,String doctoref,String cliente,String cantidad,String costo)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo.getRowCount();
        String idstat[]=null;
        int ii=00,encontrado=0;
        Object[] fnewRow = new Object[12];
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo.getValueAt(ii, 2).toString().replace("<html><b><font color=#CC0000>", "").replace("<html><b><font color=#FF6633>", "").replace("<html>", "").split(":");
                    if (idstat[0].equals(codigo))
                        {
                            encontrado=1;
                        }
                }
       if(encontrado==0)
            {
               fnewRow[0]="0";
               fnewRow[1]="SIN FOLIO";
               fnewRow[2]=codigo+":"+cliente;
               fnewRow[3]=doctoref;
               fnewRow[4]="";
               fnewRow[5]="";
               fnewRow[6]="";
               fnewRow[7]="";
               fnewRow[8]="";
               fnewRow[9]=cantidad;
               fnewRow[10]=costo;
               fnewRow[11]="";

               jtable_modelo.addRow(fnewRow);
            }
    }
private void carga_datos_distribucionalma(String idref)
    {
       String fechaeuro="";
       int columnatitulo=0;
       String mespartido="";
   int ncol=this.jtable_modelo_distribucion.getColumnCount();
    Object[] fnewRow = new Object[ncol];

        try
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_articulos_distribucion(2,'"+idref+"',1) as (folio integer,fechamov date,tipomovinve smallint,referenciainve character varying(12),fechareferencia date,clave_clie_prov character varying(16),idarticuloinve character varying(16),cantidadinve numeric,precioinve numeric,costoinve numeric,observainve character varying(80),almacen smallint,folioref smallint,submodelo character varying(4));",variables_global.getconexiongral());
            while (rs.next())
                {
                        mespartido=rs.getString("clave_clie_prov");
                        columnatitulo=this.findcolumna_idtienda(mespartido);
                        this.crea_hoja_distribucionalmacen(rs.getString("idarticuloinve"),rs.getString("cantidadinve").replace("-", ""),columnatitulo);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
     fnewRow[0]="Total Piezas:";
     jtable_modelo_distribucion.addRow(fnewRow);
     fnewRow[0]="Total Importe:";
     jtable_modelo_distribucion.addRow(fnewRow);
     this.contruir_totales_distribucionalma();
     }
private void contruir_totales_distribucionalma()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###.##");
         float totalve=0,totgeneral=0,totalimporte=0;
         int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucion.getColumnCount()-5;
         //genero los totales por tienda
          System.out.println("aqui ta chingando la madre"+numerotiendas);
         for( ii=0;ii<numerotiendas;ii++)
            {
             totalve=0;
             totalimporte=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        totalve+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+4).toString().replace(",","").replace(".",""));
                        totalimporte+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+4).toString().replace(",","").replace(".",""))*Float.valueOf(jtable_modelo_distribucion.getValueAt(i, 2).toString().replace(",",""));
                    }
                    jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+4);
                    jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalimporte)+"</b></h3></html>",i+1,ii+4);
                    totgeneral+=totalve;
            }
           totalve=0;
           for(i=0;i<totalfilasreporte;i++)
                  {
                        totalve=0;
                        for( ii=0;ii<numerotiendas;ii++)
                        {
                            totalve+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+4).toString().replace(",","").replace(".",""));
                        }
                        jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+4);
                  }
           totalve=0;
           Object[] fnewRow = new Object[numerotiendas+4];
           fnewRow[0]="%";
           for( ii=0;ii<numerotiendas;ii++)
                {
                        totalve=Float.valueOf(jtable_modelo_distribucion.getValueAt(totalfilasreporte, ii+4).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                        fnewRow[ii+4]="<html><h3><b>"+myFormatter.format((totalve/totgeneral)*100)+"%</b></h3></html>";

                }
           jtable_modelo_distribucion.addRow(fnewRow);
     }

private void contruir_totales_folios()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totgeneral=0,totalimporte=0;
         int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucion.getColumnCount()-5;
         //genero los totales por tienda
          System.out.println("aqui ta chingando la madre"+numerotiendas);

           totalve=0;
           for(i=0;i<totalfilasreporte;i++)
                  {
                        totalve=0;
                        for( ii=0;ii<numerotiendas;ii++)
                        {
                            totalve+=Float.valueOf(jtable_modelo_distribucion.getValueAt(i, ii+4).toString().replace(",","").replace(".",""));
                        }
                        jtable_modelo_distribucion.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+4);
                  }
           totalve=0;
           Object[] fnewRow = new Object[numerotiendas+4];
           fnewRow[0]="%";
         
           jtable_modelo_distribucion.addRow(fnewRow);
     }
private void distribucionmaraencero()
    {
        int numerofilas=this.jtable_modelo_distribucion.getRowCount();
        int numerocolumnas=this.jtable_modelo_distribucion.getColumnCount(),ii=0,i=0;

        for( i=0;i<numerofilas;i++)
                {
                for( ii=4;ii<numerocolumnas;ii++)
                    {
                        jtable_modelo_distribucion.setValueAt("0",i,ii);
                    }
                }
    }
private void distribucionfotos()
    {
        int numerofilas=this.jtable_modelo_fotos.getRowCount(),i=0;


        for( i=0;i<numerofilas;i++)
                {
                    jtbl_distribucionfotos.setRowHeight(i, 140);
                    jtable_modelo_fotos.setValueAt("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_distribucion.getValueAt(i, 0).toString()+".JPG\" width=\"180\" height=\"120\" border=\"0\" alt=\"Foto\"></img></p></body></html>",i,4);
                }
    }

private void dioclick_disuni(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
       String cliente[]=this.jlst_clientesdistribucion.getSelectedValue().toString().split(":");
       this.jtf_idcliente1.setText(cliente[0]);
       this.jtf_describecliente1.setText(cliente[1]);
    }

private void contruir_grafica_distribuciontotal()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucion.getColumnCount()-5;
         float totalve=0;
         for( ii=0;ii<numerotiendas;ii++)
            {
                System.out.println(totalfilasreporte);
                totalve=Float.valueOf(jtable_modelo_distribucion.getValueAt(totalfilasreporte, ii+4).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                titulografico=jtable_modelo_distribucion.getColumnName(ii+4).replace("<html><b>","").replace("</b></html>","");
                if(totalve>0)
                    {
                        datasetbarra.addValue(totalve,titulografico,"Tiendas");
                    }
            }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas de Piezas a Distribucion",datasetbarra,"Distribucion Piezas Tiendas Folio:"+this.tf_foliodistribucion.getText()+" Pz="+this.jtf_totalpiezas.getText(),"Entrada de Piezas");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }

/* private void calcularimportes()
    {
      DecimalFormat myf = new DecimalFormat("###,###,###,###,###.##");
     int numerofilas=this.jtable_modelo_detalle.getRowCount(),error=0;
    String punto="",comas="",imagen="";
    float cantidad=0,costo=0,importefila=0,descuento=0,impuesto=0,doctosubtotal=0,doctoimpuesto=0,doctodescuento=0,doctototal=0,piezasindi=0,doctoimpuestop=0,totalpd=0;
    System.out.println("calculandoimporte"+numerofilas);
     for(int i = 0 ;i < numerofilas; i++)
                {
                 try
                       {
                            cantidad = Float.valueOf(this.jtable_modelo_detalle.getValueAt(i, 7).toString()).floatValue();
                            costo = Float.valueOf(this.jtable_modelo_detalle.getValueAt(i, 8).toString()).floatValue();
                            piezasindi+=cantidad;
                            descuento=(costo*cantidad)*(Float.valueOf(this.jtable_modelo_detalle.getValueAt(i, 9).toString())/100);
                            importefila=(cantidad*costo);
                            
                            impuesto=(importefila-descuento)*Float.valueOf(this.jtable_modelo_detalle.getValueAt(i, 10).toString())/100;
                            //System.out.println(descuento+":"+impuesto);
                            doctodescuento+=descuento;
                            doctosubtotal+=importefila;
                            doctoimpuestop+=impuesto;
                            totalpd+=cantidad*Float.valueOf(this.jtable_modelo_detalle.getValueAt(i, 13).toString());

                        }
                            catch (NumberFormatException nfe) {
                            cantidad=0;
                            costo=0;
                            error=1;
                        }
                      //jtable_modelo_detalle.setValueAt(importefila,i,12);
                }
    //doctoimpuesto=(doctosubtotal-doctodescuento)*impuesto;
    doctototal=(doctosubtotal-doctodescuento)+doctoimpuestop;   
    this.jtf_doctosubtotal.setText(myf.format(doctosubtotal));
    this.jtf_doctodesc.setText(myf.format(doctodescuento));
    this.jtf_doctoimp.setText(myf.format(doctoimpuestop));
    this.jtf_doctototal.setText(myf.format(doctototal));
    //this.jtf_doctototalpd.setText(punto);
    this.jtf_doctototalpd.setText(myf.format(totalpd));
    }
 */

private void calcularimportes()
    {
     DecimalFormat miforma = new DecimalFormat("###,###,###,###,###.##");
     DecimalFormat miforma2 = new DecimalFormat("###############.##");
     int numerofilas=this.jtable_modelo_detalle.getRowCount(),error=0;
    String punto="",comas="",imagen="";
    double cantidad=0,costo=0,importefila=0,descuento=0,impuesto=0,doctosubtotal=0,doctoimpuesto=0,doctodescuento=0,doctototal=0,piezasindi=0,doctoimpuestop=0,importecostov=0,cd=0,cod=0,cdi=0,importecostovr=0;
    double canr=0,importefilar=0,descuentor=0,impuestor=0,doctosubtotalr=0,doctoimpuestor=0,doctodescuentor=0,doctototalr=0,doctoimpuestopr=0,canracum=0;
     for(int i = 0 ;i < numerofilas; i++)
                {
                 try
                       {
                            cantidad = Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 12).toString()).floatValue();
                            piezasindi+=cantidad;
                            cd=Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 15).toString()).floatValue();
                            cdi+=cd;
                            canr=cantidad+(cd*-1);
                            canracum+=canr;
                            costo = Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 8).toString()).floatValue();

                            jtable_modelo_detalle.setValueAt(miforma2.format(cantidad*costo),i,11);

                            descuento=(costo*cantidad)*(Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 9).toString())/100);
                            //real
                            descuentor=(costo*canr)*(Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 9).toString())/100);

                            importefila=(cantidad*costo);
                            //real
                            importefilar=(canr*costo);

                            //System.out.println(descuento);
                            impuesto=(importefila-descuento)*Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 10).toString())/100;
                            //real
                            impuestor=(importefilar-descuentor)*Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 10).toString())/100;

                            importecostov+=cantidad*Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 13).toString()).floatValue();
                            importecostovr+=canr*Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 13).toString()).floatValue();
                            cod+=cd*costo;
                            jtable_modelo_detalle.setValueAt(miforma2.format(cantidad*Double.valueOf(this.jtable_modelo_detalle.getValueAt(i, 13).toString()).floatValue()),i,14);
                            //System.out.println(descuento+":"+impuesto);
                            doctodescuento+=descuento;
                            doctosubtotal+=importefila;
                            doctoimpuestop+=impuesto;
                            //real
                            doctodescuentor+=descuentor;
                            doctosubtotalr+=importefilar;
                            doctoimpuestopr+=impuestor;
                        }
                        catch (NumberFormatException nfe)
                        {
                            cantidad=0;
                            costo=0;
                            error=1;
                        }
                      //jtable_modelo_detalle.setValueAt(importefila,i,12);
                }
    //doctoimpuesto=(doctosubtotal-doctodescuento)*impuesto;
    doctototal=(doctosubtotal-doctodescuento)+doctoimpuestop;
    //real
    doctototalr=(doctosubtotalr-doctodescuentor)+doctoimpuestopr;

    this.jtf_totalpiezas.setText(miforma2.format(piezasindi));
    this.jtf_doctosubtotal.setText(miforma2.format(doctosubtotal));
    this.jtf_doctodesc.setText(miforma2.format(doctodescuento));
    this.jtf_doctoimp.setText(miforma2.format(doctoimpuestop));
    this.jtf_doctototal.setText(miforma2.format(doctototal));
    this.jtf_doctototal3.setText(miforma2.format(doctototal));

    this.jtf_doctototalpd.setText(miforma2.format(importecostov));


    this.jtf_totalpiezas1.setText(miforma2.format(canracum));
    this.jtf_doctosubtotal1.setText(miforma2.format(doctosubtotalr));
    this.jtf_doctodesc1.setText(miforma2.format(doctodescuentor));
    this.jtf_doctoimp1.setText(miforma2.format(doctoimpuestopr));
    this.jtf_doctototal1.setText(miforma2.format(doctototalr));

    this.jtf_doctototalpd1.setText(miforma2.format(importecostovr));

    this.jtf_totalpiezasdif.setText(miforma2.format(piezasindi-canracum));
    this.jtf_costodif.setText(miforma2.format(cod));

    this.jtf_costodif1.setText(miforma2.format(doctototal-doctototalr));

    }


private void calcularimportesd()
    {
     DecimalFormat miforma = new DecimalFormat("###,###,###,###,###.##");
     DecimalFormat miforma2 = new DecimalFormat("###############.##");
     int numerofilas=this.jtable_modelo_detalled.getRowCount(),error=0;
    String punto="",comas="",imagen="";
    float cantidad=0,costo=0,importefila=0,descuento=0,impuesto=0,doctosubtotal=0,doctoimpuesto=0,doctodescuento=0,doctototal=0,piezasindi=0,doctoimpuestop=0,importecostov=0,cd=0,cod=0,cdi=0,importecostovr=0;
    float canr=0,importefilar=0,descuentor=0,impuestor=0,doctosubtotalr=0,doctoimpuestor=0,doctodescuentor=0,doctototalr=0,doctoimpuestopr=0,canracum=0;
     for(int i = 0 ;i < numerofilas; i++)
                {
                 try
                       {
                            cantidad = Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 12).toString()).floatValue();
                            piezasindi+=cantidad;
                            cd=Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 15).toString()).floatValue();
                            cdi+=cd;
                            canr=cantidad+(cd*-1);
                            canracum+=canr;
                            costo = Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 8).toString()).floatValue();


                            descuento=(costo*cantidad)*(Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 9).toString())/100);
                            //real
                            descuentor=(costo*canr)*(Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 9).toString())/100);

                            importefila=(cantidad*costo);
                            //real
                            importefilar=(canr*costo);

                            //System.out.println(descuento);
                            impuesto=(importefila-descuento)*Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 10).toString())/100;
                            //real
                            impuestor=(importefilar-descuentor)*Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 10).toString())/100;

                            importecostov+=cantidad*Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 13).toString()).floatValue();
                            importecostovr+=canr*Float.valueOf(this.jtable_modelo_detalled.getValueAt(i, 13).toString()).floatValue();
                            cod+=cd*costo;
                            //System.out.println(descuento+":"+impuesto);
                            doctodescuento+=descuento;
                            doctosubtotal+=importefila;
                            doctoimpuestop+=impuesto;
                            //real
                            doctodescuentor+=descuentor;
                            doctosubtotalr+=importefilar;
                            doctoimpuestopr+=impuestor;
                        }
                        catch (NumberFormatException nfe)
                        {
                            cantidad=0;
                            costo=0;
                            error=1;
                        }
                      //jtable_modelo_detalle.setValueAt(importefila,i,12);
                }
    //doctoimpuesto=(doctosubtotal-doctodescuento)*impuesto;
    doctototal=(doctosubtotal-doctodescuento)+doctoimpuestop;
    //real
    doctototalr=(doctosubtotalr-doctodescuentor)+doctoimpuestopr;

    this.jtf_totalpiezas2.setText(miforma2.format(piezasindi));
    this.jtf_doctosubtotal2.setText(miforma2.format(doctosubtotal));
    this.jtf_doctodesc2.setText(miforma2.format(doctodescuento));
    this.jtf_doctoimp2.setText(miforma2.format(doctoimpuestop));
    this.jtf_doctototal2.setText(miforma2.format(doctototal));

    }
private void verexistencias()
        {

    int numerofilas = this.jtable_modelo_existencias.getRowCount(),ii=0;
    String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_existencias.getValueAt(ii ,0)+"";
                }

    System.out.println(selectin);
            String texto="select * from x1sieuno_articulo_detalle(1,0,'','"+selectin+"') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text)";
            System.out.println(texto);
            String despartido[]=null,mi="",ma="";
            int columnatitulo=0;
            try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");

                            columnatitulo=this.findcolumna_idtiendae(despartido[0]);
                            System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                        if ((rs.getString("max")!=null) && (rs.getString("min")!=null))
                        {
                            mi=rs.getString("min");
                            ma=rs.getString("max");
                            
                        }
                    else
                        {
                            mi="0";
                            ma="0";
                        }
                    if ( columnatitulo>0)
                        {
                            this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),columnatitulo,mi,ma);
                        }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
            
        }
 private void crea_hoja_agregaexistencias(String codigo,String existencia,int columna,String smin,String smax)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_existencias.getRowCount(),numerocolumnas=this.jtable_modelo_existencias.getColumnCount(),ii=00,encontrado=0;
        String mesactual="",colorabre="",colorcierra="";

        float abononumerico=0,importe=0;
       //invoco al metodo que trae el recordset de datos
        abononumerico=Float.valueOf(existencia);

        importe=100-((Float.valueOf(existencia)/Float.valueOf(smax))*100);
        //System.out.println("Verificando :"+smax+" "+existencia+ " "+importe);
                if (importe<=50)
                    {
                        colorabre="<b><font color=#CC0000>";
                        colorcierra="<font></b>";
                    }
                if ((importe>50) && (importe<=75))
                    {
                        colorabre="<b><font color=#FF6633>";
                        colorcierra="<font></b>";
                    }
                if (importe>75)
                    {
                        colorabre="<font color=#008000>";
                        colorcierra="<font>";
                    }
                if ((importe==0) && (abononumerico==0))
                    {
                        colorabre="";
                        colorcierra="";
                    }
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_existencias.getValueAt(ii, 0).toString();
                    // System.out.println("Agregando:"+mesactual+" "+mes);
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;


                            jtable_modelo_existencias.setValueAt("<html><b>"+colorabre+"M"+smin+" Mx"+smax+" E="+miformat.format(abononumerico)+colorcierra+"</b></html>",ii ,columna);
                        }
                }
    }
 private int findcolumna_idtiendae(String titulo)  {
        int columnas = jtb_catalogo_artiexis.getColumnCount(),columencontrado=0;
        String columtitulo[]=null;
      for(int j = 2 ;j < columnas ; j++)
            {
                   columtitulo= jtb_catalogo_artiexis.getColumnName(j).replace("<html><b>","").replace("</b></html>","").split(":");
                if(columtitulo[0].equals(titulo))
                    {
                            columencontrado=j;
                            j=columnas;
                    }
            }
    //System.out.println("Esto encontro:"+columencontrado);
    return columencontrado;
}

private String fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

private String fechaamericana(String fecha) {

         //resibe cadena de fecha en formato americano dd-MM-yyyy
       java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaamericano = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateador.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaamericano.format(fechaestaeuropa);
       return cadenafecha;

    }
private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jt_detallecompra.getSelectedColumn();
         int folio=0;
         int fila = jt_detallecompra.getSelectedRow();
         String idcadena=this.jt_detallecompra.getValueAt(fila, 0).toString();

         try
             {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
                while (rs.next())
                        {

                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);

                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }

private void dioclickidartideta(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtb_catalogo_artiexis.getSelectedRow();
         
         this.jtf_idarticulo_fotostock.setText(jtable_modelo_existencias.getValueAt(fila, 0).toString());
         this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_existencias.getValueAt(fila, 0).toString()+".JPG\" width=\"180\" height=\"140\" border=\"0\" alt=\"Foto Articulo\"></img>");
         this.carga_articulo_estadisticas("0",jtable_modelo_existencias.getValueAt(fila, 0).toString());
    }
private void dioclickd(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_distribucion.getSelectedColumn();
         int folio=0;
         int fila = jtbl_distribucion.getSelectedRow();
         String idcadena=this.jtbl_distribucion.getValueAt(fila, 0).toString();


        com_distri_articulos_almacen_detalle fcdaad=new com_distri_articulos_almacen_detalle(1,idcadena);
        fcdaad.pack();
        fcdaad.setVisible(true);

    }
private void dioclickdu(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_distribucion.getSelectedColumn();
         this.crea_hoja_compraindi(columna);
    }
private void dioclickf(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
         int columna =jtbl_distribucionfotos.getSelectedColumn();
         int folio=0;
         int fila = jtbl_distribucionfotos.getSelectedRow();
         String idcadena=this.jtbl_distribucionfotos.getValueAt(fila, 0).toString();
         rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
         try
             {
                while (rs.next())
                        {

                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);

                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        //setVisible(false);
    }
private void carga_datos(int opbus,String tbusca)
    {
        String fechacat = "",fechallegatienda="",fechaentrega="";
         DecimalFormat miformat = new DecimalFormat("############.##");
         String abrehtml="",cierrahtml="",texto="";
         float tpz=0,timporte=0;
       while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
         texto="select * from x1distribucion_terminados_ventas_catalogov2('"+variables_global.getcliente_tistribucion()+"',"+opbus+",'"+tbusca+"') as (idreg integer,id character varying(12),idesta smallint,desta character varying(15), claveperdoc character varying(45),dante character varying(12), doctosig character varying(12),fedoc text,feent text,fechaven date,impuesto1 numeric,impuesto2 numeric,descuentotot numeric,descuentofin numeric,idcliente character varying(12),nomclie character varying(60),obserdoc character varying(80), usuario character varying(20),flete numeric,guia character varying(60), fechaenvio date,idmoneda smallint,descripmoneda character varying(30),idalmacen smallint,describamacen character varying(30),total numeric,tpz numeric,distra integer,clasif smallint,distrans2 integer);";
       //invoco al metodo que trae el recordset de datos
        System.out.println("ho:"+texto);
        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                tpz+=rs.getFloat("tpz");
                timporte+=rs.getFloat("total");
                 switch (rs.getInt("idesta"))
                    {
                        case 1:
                            abrehtml="";
                            cierrahtml="";
                        break;
                        case 4:
                            abrehtml="";
                            cierrahtml="";
                        break;
                        default:
                             abrehtml="";
                            cierrahtml="";
                        break;
                    }
                 if(rs.getString("fechaven")!=null)
                        {
                           fechallegatienda=""+ rs.getString("fechaven")+"";
                        }
                    if(rs.getString("feent")!=null)
                        {
                            fechaentrega="<html>"+this.fechaeuropea(rs.getString ("feent"))+":<br>"+this.DiaSemana(this.fechaeuropea(rs.getString("feent")))+"</html>";
                        }
                fechacat="<html>"+rs.getString("fedoc")+":<br>"+DiaSemana(this.fechaeuropea(rs.getString("fedoc")))+"</html>";
                jtable_modelo.addRow(new Object[]{rs.getString ("id"),abrehtml+rs.getString ("idesta")+":"+rs.getString ("desta")+cierrahtml,abrehtml+rs.getString ("idcliente")+":"+rs.getString ("nomclie")+cierrahtml,abrehtml+rs.getString ("dante")+cierrahtml,fechacat,fechallegatienda,fechaentrega,abrehtml+rs.getString ("distra")+cierrahtml,abrehtml+rs.getString ("guia")+cierrahtml,abrehtml+miformat.format(rs.getFloat("tpz"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("total"))+cierrahtml,abrehtml+rs.getString ("obserdoc")+cierrahtml});
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        jtable_modelo.addRow(new Object[]{"Total:","","","","","","","","",miformat.format(tpz),miformat.format(timporte),""});
/*        texto="select * from x1distribucion_terminados_almacen_entradas_catalogo(2,'"+tbusca+"','') as (idfol integer,id character varying(12),idesta smallint,desta character varying(15),claveperdoc character varying(12),dante character varying(12),dsiguiente character varying(12), fedoc date,feent date,fechaven date,impuesto numeric,impuesto2 numeric,destotot numeric,destofinan numeric,idproveedor character varying(12), idprovdescribe character varying(60),obserdoc character varying(255),usuario character varying(12), flete numeric,guia character varying(60),fechaenvio date,idmoneda smallint,describemoneda character varying(30),idalmacen smallint,describealmacehr character varying(30),pzaente numeric,pzasal numeric,importeent numeric,importesal numeric);";
        System.out.println("ho:"+texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    if(rs.getString("fechaven") != null)
                        {
                           fechallegatienda="<html>"+ this.fechaeuropea(rs.getString("fechaven"))+":<br>"+DiaSemana(this.fechaeuropea(rs.getString ("fechaven")))+"</html>";
                        }
                    if(rs.getString("feent")!=null)
                        {
                            fechaentrega="<html>"+rs.getString ("feent")+":<br>"+this.DiaSemana(this.fechaeuropea(rs.getString("feent")))+"</html>";
                        }
                fechacat="<html>"+this.fechaeuropea(rs.getString ("fedoc"))+":<br>"+DiaSemana(this.fechaeuropea(rs.getString("fedoc"))+"</html>");
                switch (rs.getInt("idesta"))
                    {
                        case 1:
                            jtable_modelo.addRow(new Object[]{rs.getString ("id"),rs.getString("idesta")+":"+rs.getString("desta"),"09:Entrada Almacen",rs.getString ("dante"),fechacat,fechallegatienda,fechaentrega,"",abrehtml+rs.getString ("guia")+cierrahtml,abrehtml+miformat.format(rs.getFloat("pzasal"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("importesal"))+cierrahtml,abrehtml+rs.getString ("obserdoc")+cierrahtml});
                        break;
                        case 2:
                            jtable_modelo.addRow(new Object[]{rs.getString ("id"),rs.getString("idesta")+":"+rs.getString("desta"),"0:DIFERENCIA FALTANTE O SOBRANTE",rs.getString ("dante"),fechacat,fechallegatienda,fechaentrega,"",abrehtml+rs.getString ("guia")+cierrahtml,abrehtml+miformat.format(rs.getFloat("pzasal"))+cierrahtml,abrehtml+miformat.format(rs.getFloat("importesal"))+cierrahtml,abrehtml+rs.getString ("obserdoc")+cierrahtml});
                        break;
                    }
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
*/

       int numerofilas=this.jtable_modelo.getRowCount();
             for(int i = 0 ;i < numerofilas; i++)
                {
                     jtbl_recepciones.setRowHeight(i, 30);
                }
         alinearderecha = new DefaultTableCellRenderer();
        alinearderecha.setHorizontalAlignment(SwingConstants.RIGHT);

        jtbl_recepciones.getColumnModel().getColumn(9).setCellRenderer(alinearderecha);
        jtbl_recepciones.getColumnModel().getColumn(10).setCellRenderer(alinearderecha);
        //jtbl_recepciones.getColumnModel().getColumn(11).setCellRenderer(alinearderecha);

      }
private void carga_datos_distribucionxclie(String idref)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###,###.##");
        String texto="select * from x1distribucion_terminados_distribucion_xcliente(1,'"+idref+"','') as (idref character varying(12),idclieoprov character varying(16),cantpza numeric,costoinve numeric,precioinve numeric,precio5 numeric,clieoprovdesc character varying(60));";
        System.out.println(texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        this.crea_hoja_distribucionaclientes(rs.getString("idclieoprov"),rs.getString("idref"),rs.getString("clieoprovdesc"),rs.getString("cantpza"),miformat.format(rs.getFloat("precioinve")));
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       


        int numerofilas=this.jtable_modelo.getRowCount();
             for(int i = 0 ;i < numerofilas; i++)
                {
                     jtbl_recepciones.setRowHeight(i, 30);
                }
     }
 void cambiartamanofilas()
 {
     //limpiar la tabla


       int numerofilas=this.jtable_modelo.getRowCount();

             for(int i = 0 ;i < numerofilas; i++)
                {
                     jtbl_recepciones.setRowHeight(i, 30);
                }
  }
 private void dioclickr(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        int fila = jtbl_recepciones.getSelectedRow();
        Object valor = jtbl_recepciones.getValueAt(fila, 0);
        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        com_distri_folios_detalle fdd=new com_distri_folios_detalle(String.valueOf(valor));
        fdd.pack();
        fdd.setVisible(true);
    }
 private void dioclickgenven(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click en subfamilia");
            int fila = jtbl_recepciones.getSelectedRow(),folio=Integer.valueOf(this.jtable_modelo.getValueAt(fila, 0).toString().replace("<html><b><font color=#CC0000>", "").replace("<html><b><font color=#FF6633>", "").replace("<html>", "").replace("<font></b></html>","").replace("</html>", "")),piezas=Integer.valueOf(this.jtable_modelo.getValueAt(fila, 9).toString().replace("<html><b><font color=#CC0000>", "").replace("<html><b><font color=#FF6633>", "").replace("<html>", "").replace("<font></b></html>","").replace("</html>", ""));
            String cliente[]=this.jtable_modelo.getValueAt(fila, 2).toString().split(":");
            //if ((folio==0) && (piezas>0))
            this.jtf_idffila.setText(String.valueOf(fila));
            if (folio==0)
                {
                    this.jtf_idcliente.setText(cliente[0]);
                    this.jtf_describecliente.setText(cliente[1]);
                    this.jtf_pzasdistri.setText(String.valueOf(piezas));
                    this.jtf_idcliente.setVisible(true);
                    this.jtf_describecliente.setVisible(true);
                    this.jtf_pzasdistri.setVisible(true);
                    this.jbtn_generarventa.setVisible(true);
                    this.jtf_idcliente1.setText(cliente[0]);
                    this.jtf_describecliente1.setText(cliente[1]);
                    this.jtf_pzasdistri1.setText(this.jtable_modelo.getValueAt(fila,10).toString());

                }
            else
                {
                    this.jtf_idcliente.setVisible(false);
                    this.jtf_describecliente.setVisible(false);
                    this.jtf_pzasdistri.setVisible(false);
                    this.jbtn_generarventa.setVisible(false);
                    this.tf_foliotienda.setText(String.valueOf(folio));
                    this.tf_foliotienda1.setText(cliente[0]);
                }
              // this.jtf_idcliente1.setText(cliente[0]);
              // this.jtf_describecliente1.setText(cliente[1]);
    }

 private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;
    }

private String PesosMN(float total)
{
float lyCantidad=0, lyCentavos=0,totalf=0;
int lnDigito=0, lnPrimerDigito=0, lnSegundoDigito=0, lnTercerDigito=0,lnNumeroBloques=0,lnBloqueCero=0,I=0;
String lcBloque="",lcbloquefinal="",pesosmn="",pesosmnfinal="";


lyCantidad =  (int) (Math.round(total));
System.out.println("dividir Primero::"+lyCantidad+" ");
lyCentavos = (lyCantidad-total ) * 100;
String laUnidades[] = {"UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTE", "VEINTIUN", "VEINTIDOS", "VEINTITRES", "VEINTICUATRO", "VEINTICINCO", "VEINTISEIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE"};
String laDecenas[] = {"DIEZ", "VEINTE", "TREINTA", "CUARENTA", "CINCUENTA", "SESENTA", "SETENTA", "OCHENTA", "NOVENTA"};
String laCentenas[] = {"CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS"};
lnNumeroBloques = 1;
do
{
    lnPrimerDigito = 0;
    lnSegundoDigito = 0;
    lnTercerDigito = 0;
    
    lcBloque = "";
    lnBloqueCero = 0;
    for(I=1;I<4;I++)
		{
			lnDigito =  (int) (lyCantidad % 10);
            System.out.println("mod Primero::"+lnDigito+" For"+I);
			if (lnDigito != 0)
				{
					switch(I)
					{
						case 1:
							lcBloque = " " + laUnidades[lnDigito - 1];
							lnPrimerDigito = lnDigito;
						break;
                        case 2:
							if(lnDigito <= 2){
                                    lcBloque = "  " + laUnidades[(lnDigito * 10) + lnPrimerDigito - 1];
								}
							else{
                                    lcbloquefinal=lcBloque;
                                    lcBloque = "  " + laDecenas[lnDigito - 1];
                                    if(lnPrimerDigito != 0){
                                        	lcBloque+=" Y";
                                        }
									 lcBloque+=lcbloquefinal;
								}
								lnSegundoDigito = lnDigito;
						break;
                        case 3:
								lcbloquefinal=lcBloque;
								lcBloque = " ";
								if((lnDigito == 1) && (lnPrimerDigito == 0) && (lnSegundoDigito == 0)){
										lcBloque+="CIEN";
									}
									lcBloque+=laCentenas[lnDigito - 1];
									lcBloque+=lcbloquefinal;
                                    lnTercerDigito = lnDigito;
						break;
					}
				}
			else{
					lnBloqueCero = lnBloqueCero + 1;
				}
//System.out.println("dividir antes::"+lyCantidad+" ");
		lyCantidad = (int)(lyCantidad / 10);
System.out.println("dividir despues::"+lyCantidad+" ");
		if(lyCantidad == 0){
            			I=3;
                        System.out.println("Fin del For:"+lyCantidad+" ");
                }
	}//fin del for
	switch(lnNumeroBloques)
	{
		case 1:
			pesosmn = lcBloque;
		break;
		case 2:
			pesosmnfinal=pesosmn;
			pesosmn = lcBloque;
				if(lnBloqueCero == 3)
					{}
				else{
					pesosmn+=" MIL";
				}
				pesosmn+=pesosmnfinal;
		break;
		case 3:
			pesosmnfinal=pesosmn;
			pesosmn = lcBloque;
			if((lnPrimerDigito == 1) && (lnSegundoDigito == 0) && (lnTercerDigito == 0))
				{
				pesosmn+=" MILLON";
				}
			else
				{
				pesosmn+=" MILLONES";
				}
			pesosmn+=pesosmnfinal;
		break;
	}
    System.out.println("bloque:"+lcBloque+" ");
	lnNumeroBloques = lnNumeroBloques + 1;
}
while(lyCantidad != 0);
pesosmn="" + pesosmn;
if( total > 1)
{
	pesosmn+=" PESOS ";
}
else
{
	pesosmn+=" PESO ";
}
pesosmn+=String.valueOf(lyCentavos) + "/100 M.N.)";
return pesosmn;
}


private void imprimir(int pag,float ptotal,String folio)
    {

     java.util.Date fechahoya=new Date();

     this.objimpresora=new com_distri_folios_imprimir();
    System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     this.objimpresora.setOneItem_cadenas_a_imprimir("            Id-Rep:C1                S.I.:Compra Articulos");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Documento:"+this.tf_fecha.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio:"+this.tf_foliodistribucion.getText()+"     Folio Referencia:"+this.tf_foliodoctoanterior.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Proveedor:"+this.jtf_idproveedor.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jep_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     if((pag+1)>=ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Piezas: "+this.jtf_totalpiezas.getText()+"       Subtotal: $"+this.jtf_doctosubtotal.getText()+"           Descuento:$"+this.jtf_doctodesc.getText()+"           Impuesto:$"+this.jtf_doctoimp.getText()+"           Total: $"+this.jtf_doctototal.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Recibidas: "+this.jtf_totalpiezas1.getText()+"       Subtotal:$"+this.jtf_doctosubtotal1.getText()+"           Descuento:$"+this.jtf_doctodesc1.getText()+"           Impuesto:$"+this.jtf_doctoimp1.getText()+"           Total: $"+this.jtf_doctototal1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Difencia:" +this.jtf_totalpiezasdif.getText()+"       Costo sin iva/sin desc. Faltante/Sobrante:$"+this.jtf_costodif.getText()+"             Total Diferencia:"+this.jtf_costodif1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("..");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Costo Integrado Recibido: "+this.jtf_doctototalpd1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Importe Flete: $"+this.jtf_flete.getText());
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_detallecompra);
     this.objimpresora.imprimir_all(24,pag);
    }

private void imprimirdif(int pag,float ptotal,String folio)
    {

     java.util.Date fechahoya=new Date();

     this.objimpresora=new com_distri_folios_imprimir();

     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep: C2                         S.I.:Compra Articulos:Diferencias de Proveedor");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Documento:"+this.tf_fecha.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio:"+this.tf_foliodistribucion.getText()+"     Folio Referencia:"+this.tf_foliodoctoanterior.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Status Documento:"+this.tf_status.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Proveedor:"+this.jtf_idproveedor.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jep_observaciones.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     if((pag+1)>ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Piezas: "+this.jtf_totalpiezas2.getText()+"       Subtotal: $"+this.jtf_doctosubtotal2.getText()+"           Descuento:$"+this.jtf_doctodesc2.getText()+"           Impuesto:$"+this.jtf_doctoimp2.getText()+"           Total: $"+this.jtf_doctototal2.getText());
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_detallecompra1);
     this.objimpresora.imprimir_all(18,pag);
    }

private void imprimir_detalle(int pag,float ptotal,String folio)
    {
     java.util.Date fechahoya=new Date();
     this.objimpresora=new com_distri_folios_imprimir();
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Id-Rep:C3                            S.I.:Compras(Distribucion de Compra Por Cliente o Tienda");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha de Reporte:"+this.fechaeuropea(fechahoy)+"  Hora"+fechahoy.getHours()+":"+fechahoy.getMinutes());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Proveedor:"+this.jtf_idproveedor.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Fecha Sistema:"+this.tf_fecha.getText()+"        Fecha Documento Prove:"+this.tf_fechareferencia.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio Distribucion:"+this.tf_foliodistribucion.getText()+"            Docuemto Ref. Proveedor:"+this.tf_foliodoctoanterior.getText()+" ");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jep_observaciones.getText()+" ");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("          Cliente/Tienda:"+this.jtf_clientedetalle.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     /*if((pag+1)>ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Piezas: "+this.jtf_totalpiezas.getText()+"       Subtotal: $"+this.jtf_doctosubtotal.getText()+"           Descuento:$"+this.jtf_doctodesc.getText()+"           Impuesto:$"+this.jtf_doctoimp.getText()+"           Total: $"+this.jtf_doctototal.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Recibidas: "+this.jtf_totalpiezas1.getText()+"       Subtotal:$"+this.jtf_doctosubtotal1.getText()+"           Descuento:$"+this.jtf_doctodesc1.getText()+"           Impuesto:$"+this.jtf_doctoimp1.getText()+"           Total: $"+this.jtf_doctototal1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          pz Difencia:" +this.jtf_totalpiezasdif.getText()+"       Costo sin iva/sin desc. Faltante/Sobrante:$"+this.jtf_costodif.getText()+"             Total Diferencia:"+this.jtf_costodif1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("..");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Costo Integrado Recibido: "+this.jtf_doctototalpd1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Importe Flete: $"+this.jtf_flete.getText());
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");
*/
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jtbl_recepciones);
     this.objimpresora.imprimir_all(21,pag);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Fodioclickrrm Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        jPanel3 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jtf_idproveedor = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tf_status = new javax.swing.JTextField();
        tf_foliodoctoanterior = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        tf_foliodistribucion = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        tf_fecha = new javax.swing.JTextField();
        tf_fechareferencia = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        tf_fecharecepcion = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtf_viaje = new javax.swing.JTextField();
        jbtn_provestadistica = new javax.swing.JButton();
        jep_observaciones = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jtf_importeprecio = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jtf_flete = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jLabel44 = new javax.swing.JLabel();
        jtf_doctoblister = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_detallecompra = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jLabel14 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jrbtn_columnaclave = new javax.swing.JRadioButton();
            jRadioButton1 = new javax.swing.JRadioButton();
            jrbtn_item = new javax.swing.JRadioButton();
            jLabel15 = new javax.swing.JLabel();
            jtf_buscarenjtable = new javax.swing.JTextField();
            jlb_resultado = new javax.swing.JLabel();
            jCheckBox1 = new javax.swing.JCheckBox();
            jPanel10 = new javax.swing.JPanel();
            jLabel9 = new javax.swing.JLabel();
            jtf_totalpiezas = new javax.swing.JTextField();
            jLabel22 = new javax.swing.JLabel();
            jtf_doctosubtotal = new javax.swing.JTextField();
            jLabel23 = new javax.swing.JLabel();
            jtf_doctodesc = new javax.swing.JTextField();
            jLabel24 = new javax.swing.JLabel();
            jtf_doctoimp = new javax.swing.JTextField();
            jLabel25 = new javax.swing.JLabel();
            jtf_doctototal = new javax.swing.JTextField();
            jLabel26 = new javax.swing.JLabel();
            jtf_doctototalpd = new javax.swing.JTextField();
            jLabel28 = new javax.swing.JLabel();
            jtf_doctosubtotal1 = new javax.swing.JTextField();
            jLabel29 = new javax.swing.JLabel();
            jtf_doctodesc1 = new javax.swing.JTextField();
            jLabel30 = new javax.swing.JLabel();
            jtf_doctoimp1 = new javax.swing.JTextField();
            jLabel31 = new javax.swing.JLabel();
            jtf_doctototal1 = new javax.swing.JTextField();
            jLabel32 = new javax.swing.JLabel();
            jtf_doctototalpd1 = new javax.swing.JTextField();
            jLabel33 = new javax.swing.JLabel();
            jtf_totalpiezasdif = new javax.swing.JTextField();
            jLabel34 = new javax.swing.JLabel();
            jtf_costodif = new javax.swing.JTextField();
            jLabel35 = new javax.swing.JLabel();
            jtf_totalpiezas1 = new javax.swing.JTextField();
            jLabel36 = new javax.swing.JLabel();
            jtf_costodif1 = new javax.swing.JTextField();
            jPanel2 = new javax.swing.JPanel();
            jScrollPane3 = new javax.swing.JScrollPane();
            jtbl_distribucion = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jchk_graficadistribucion = new javax.swing.JCheckBox();
                jLabel16 = new javax.swing.JLabel();
                jLabel17 = new javax.swing.JLabel();
                jrbtn_columnaclave1 = new javax.swing.JRadioButton();
                jrbtn_item1 = new javax.swing.JRadioButton();
                jLabel18 = new javax.swing.JLabel();
                jtf_buscarenjtable1 = new javax.swing.JTextField();
                jlb_resultado1 = new javax.swing.JLabel();
                jButton1 = new javax.swing.JButton();
                jtf_doctototal3 = new javax.swing.JTextField();
                jPanel4 = new javax.swing.JPanel();
                jScrollPane4 = new javax.swing.JScrollPane();
                jtbl_distribucionfotos = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }}
                    ;
                    jLabel19 = new javax.swing.JLabel();
                    jLabel20 = new javax.swing.JLabel();
                    jrbtn_columnaclave2 = new javax.swing.JRadioButton();
                    jRadioButton2 = new javax.swing.JRadioButton();
                    jrbtn_item2 = new javax.swing.JRadioButton();
                    jLabel21 = new javax.swing.JLabel();
                    jtf_buscarenjtable2 = new javax.swing.JTextField();
                    jlb_resultado2 = new javax.swing.JLabel();
                    jPanel5 = new javax.swing.JPanel();
                    jScrollPane5 = new javax.swing.JScrollPane();
                    jtbl_recepciones = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        jbtn_cargardistribucionxclie = new javax.swing.JButton();
                        jtf_idcliente = new javax.swing.JTextField();
                        jtf_describecliente = new javax.swing.JTextField();
                        jtf_pzasdistri = new javax.swing.JTextField();
                        jbtn_generarventa = new javax.swing.JButton();
                        jtf_idffila = new javax.swing.JTextField();
                        jPanel14 = new javax.swing.JPanel();
                        jLabel42 = new javax.swing.JLabel();
                        jtf_observa_update = new javax.swing.JTextField();
                        jbtn_actualizar = new javax.swing.JButton();
                        tf_foliodoctoanteriorupda = new javax.swing.JTextField();
                        jLabel11 = new javax.swing.JLabel();
                        jbtn_actualizar1 = new javax.swing.JButton();
                        jLabel43 = new javax.swing.JLabel();
                        tf_foliodoctoanteriorupda1 = new javax.swing.JTextField();
                        jbtn_actualizar2 = new javax.swing.JButton();
                        tf_foliotienda = new javax.swing.JTextField();
                        tf_foliotienda1 = new javax.swing.JTextField();
                        jbtn_generarventa1 = new javax.swing.JButton();
                        jtf_totalletras = new javax.swing.JTextField();
                        jbtn_imprimirdetalle = new javax.swing.JButton();
                        jtf_idcliente1 = new javax.swing.JTextField();
                        jtf_describecliente1 = new javax.swing.JTextField();
                        jbtn_generarventa2 = new javax.swing.JButton();
                        jtf_pzasdistri1 = new javax.swing.JTextField();
                        jScrollPane8 = new javax.swing.JScrollPane();
                        jlst_clientesdistribucion = new javax.swing.JList();
                        jPanel6 = new javax.swing.JPanel();
                        jScrollPane6 = new javax.swing.JScrollPane();
                        jt_detallecomprasae = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}
                            ;
                            jPanel7 = new javax.swing.JPanel();
                            jPanel8 = new javax.swing.JPanel();
                            jScrollPane11 = new javax.swing.JScrollPane();
                            jep_articuloimagen = new javax.swing.JEditorPane();
                            jtf_idarticulo_fotostock = new javax.swing.JTextField();
                            jbtn_imagenfull = new javax.swing.JButton();
                            jtf_fotoidstocks2 = new javax.swing.JTextField();
                            jPanel9 = new javax.swing.JPanel();
                            jScrollPane7 = new javax.swing.JScrollPane();
                            jtb_catalogo_artiexis = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                jPanel24 = new javax.swing.JPanel();
                                jScrollPane16 = new javax.swing.JScrollPane();
                                jtbl_estadisticasarticulo1 = new javax.swing.JTable(){
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }}
                                    ;
                                    jPanel11 = new javax.swing.JPanel();
                                    jScrollPane2 = new javax.swing.JScrollPane();
                                    jt_detallecompra1 = new javax.swing.JTable(){
                                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                                            return false;
                                        }}
                                        ;
                                        jLabel37 = new javax.swing.JLabel();
                                        jtf_totalpiezas2 = new javax.swing.JTextField();
                                        jLabel38 = new javax.swing.JLabel();
                                        jtf_doctosubtotal2 = new javax.swing.JTextField();
                                        jLabel39 = new javax.swing.JLabel();
                                        jtf_doctodesc2 = new javax.swing.JTextField();
                                        jLabel40 = new javax.swing.JLabel();
                                        jtf_doctoimp2 = new javax.swing.JTextField();
                                        jLabel41 = new javax.swing.JLabel();
                                        jtf_doctototal2 = new javax.swing.JTextField();
                                        jMenuBar1 = new javax.swing.JMenuBar();
                                        jMenu1 = new javax.swing.JMenu();
                                        jmni_salir = new javax.swing.JMenuItem();
                                        jMenu2 = new javax.swing.JMenu();
                                        jmni_escape = new javax.swing.JMenuItem();
                                        jmni_imprimir = new javax.swing.JMenuItem();
                                        jmni_distribucion = new javax.swing.JMenuItem();
                                        jmni_foliotiendas = new javax.swing.JMenuItem();
                                        jmni_documentodif = new javax.swing.JMenuItem();
                                        jMenuItem1 = new javax.swing.JMenuItem();
                                        jMenu3 = new javax.swing.JMenu();

                                        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                                        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(com_distri_compras_detalle.class);
                                        setTitle(resourceMap.getString("Form.title")); // NOI18N
                                        setName("Form"); // NOI18N

                                        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
                                        jPanel3.setName("jPanel3"); // NOI18N

                                        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                        jLabel6.setName("jLabel6"); // NOI18N

                                        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                        jLabel5.setName("jLabel5"); // NOI18N

                                        jtf_idproveedor.setEditable(false);
                                        jtf_idproveedor.setFont(resourceMap.getFont("jtf_idproveedor.font")); // NOI18N
                                        jtf_idproveedor.setName("jtf_idproveedor"); // NOI18N
                                        jtf_idproveedor.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_idproveedorActionPerformed(evt);
                                            }
                                        });

                                        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                        jLabel4.setName("jLabel4"); // NOI18N

                                        tf_status.setEditable(false);
                                        tf_status.setFont(resourceMap.getFont("tf_status.font")); // NOI18N
                                        tf_status.setName("tf_status"); // NOI18N

                                        tf_foliodoctoanterior.setEditable(false);
                                        tf_foliodoctoanterior.setFont(resourceMap.getFont("tf_foliodoctoanterior.font")); // NOI18N
                                        tf_foliodoctoanterior.setName("tf_foliodoctoanterior"); // NOI18N
                                        tf_foliodoctoanterior.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_foliodoctoanteriorActionPerformed(evt);
                                            }
                                        });

                                        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                        jLabel3.setName("jLabel3"); // NOI18N

                                        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                                        jLabel2.setName("jLabel2"); // NOI18N

                                        tf_foliodistribucion.setEditable(false);
                                        tf_foliodistribucion.setFont(resourceMap.getFont("tf_foliodistribucion.font")); // NOI18N
                                        tf_foliodistribucion.setName("tf_foliodistribucion"); // NOI18N

                                        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                        jLabel1.setName("jLabel1"); // NOI18N

                                        tf_fecha.setEditable(false);
                                        tf_fecha.setFont(resourceMap.getFont("tf_fecha.font")); // NOI18N
                                        tf_fecha.setName("tf_fecha"); // NOI18N
                                        tf_fecha.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_fechaActionPerformed(evt);
                                            }
                                        });

                                        tf_fechareferencia.setEditable(false);
                                        tf_fechareferencia.setFont(resourceMap.getFont("tf_fechareferencia.font")); // NOI18N
                                        tf_fechareferencia.setName("tf_fechareferencia"); // NOI18N
                                        tf_fechareferencia.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_fechareferenciaActionPerformed(evt);
                                            }
                                        });

                                        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                        jLabel7.setName("jLabel7"); // NOI18N

                                        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
                                        jLabel10.setName("jLabel10"); // NOI18N

                                        tf_fecharecepcion.setEditable(false);
                                        tf_fecharecepcion.setFont(resourceMap.getFont("tf_fecharecepcion.font")); // NOI18N
                                        tf_fecharecepcion.setName("tf_fecharecepcion"); // NOI18N
                                        tf_fecharecepcion.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_fecharecepcionActionPerformed(evt);
                                            }
                                        });

                                        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                        jLabel8.setName("jLabel8"); // NOI18N

                                        jtf_viaje.setEditable(false);
                                        jtf_viaje.setFont(resourceMap.getFont("jtf_viaje.font")); // NOI18N
                                        jtf_viaje.setText(resourceMap.getString("jtf_viaje.text")); // NOI18N
                                        jtf_viaje.setName("jtf_viaje"); // NOI18N

                                        jbtn_provestadistica.setIcon(resourceMap.getIcon("jbtn_provestadistica.icon")); // NOI18N
                                        jbtn_provestadistica.setText(resourceMap.getString("jbtn_provestadistica.text")); // NOI18N
                                        jbtn_provestadistica.setName("jbtn_provestadistica"); // NOI18N
                                        jbtn_provestadistica.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_provestadisticaActionPerformed(evt);
                                            }
                                        });

                                        jep_observaciones.setText(resourceMap.getString("jep_observaciones.text")); // NOI18N
                                        jep_observaciones.setName("jep_observaciones"); // NOI18N

                                        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                                        jLabel12.setName("jLabel12"); // NOI18N

                                        jtf_importeprecio.setEditable(false);
                                        jtf_importeprecio.setFont(resourceMap.getFont("jtf_importeprecio.font")); // NOI18N
                                        jtf_importeprecio.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_importeprecio.setText(resourceMap.getString("jtf_importeprecio.text")); // NOI18N
                                        jtf_importeprecio.setName("jtf_importeprecio"); // NOI18N

                                        jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
                                        jLabel27.setName("jLabel27"); // NOI18N

                                        jtf_flete.setEditable(false);
                                        jtf_flete.setFont(resourceMap.getFont("jtf_flete.font")); // NOI18N
                                        jtf_flete.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_flete.setName("jtf_flete"); // NOI18N
                                        jtf_flete.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_fleteActionPerformed(evt);
                                            }
                                        });

                                        jButton2.setIcon(resourceMap.getIcon("jButton2.icon")); // NOI18N
                                        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
                                        jButton2.setName("jButton2"); // NOI18N
                                        jButton2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jButton2ActionPerformed(evt);
                                            }
                                        });

                                        jLabel44.setText(resourceMap.getString("jLabel44.text")); // NOI18N
                                        jLabel44.setName("jLabel44"); // NOI18N

                                        jtf_doctoblister.setEditable(false);
                                        jtf_doctoblister.setFont(resourceMap.getFont("jtf_doctoblister.font")); // NOI18N
                                        jtf_doctoblister.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctoblister.setName("jtf_doctoblister"); // NOI18N
                                        jtf_doctoblister.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_doctoblisterActionPerformed(evt);
                                            }
                                        });

                                        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                        jPanel3.setLayout(jPanel3Layout);
                                        jPanel3Layout.setHorizontalGroup(
                                            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addComponent(jLabel1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(3, 3, 3)
                                                        .addComponent(jLabel7)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_fechareferencia, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jLabel10)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_fecharecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_viaje, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jLabel5)
                                                                .addGap(34, 34, 34)
                                                                .addComponent(jtf_idproveedor, javax.swing.GroupLayout.PREFERRED_SIZE, 288, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jbtn_provestadistica)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel6)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jep_observaciones))
                                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jLabel2)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(tf_foliodistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(20, 20, 20)
                                                                .addComponent(jLabel3)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(tf_foliodoctoanterior, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jLabel4)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                .addComponent(jLabel12)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jLabel27)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_flete, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE))
                                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jLabel44)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_doctoblister, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)))))
                                                .addContainerGap())
                                        );
                                        jPanel3Layout.setVerticalGroup(
                                            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel3Layout.createSequentialGroup()
                                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel1)
                                                        .addComponent(tf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(tf_fechareferencia, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel7)
                                                        .addComponent(jLabel10)
                                                        .addComponent(tf_fecharecepcion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel8)
                                                        .addComponent(jtf_viaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jButton2)))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel2)
                                                    .addComponent(tf_foliodistribucion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(tf_foliodoctoanterior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel4)
                                                    .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel12)
                                                    .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_flete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel27))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel5)
                                                    .addComponent(jtf_idproveedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jbtn_provestadistica)
                                                    .addComponent(jLabel6)
                                                    .addComponent(jep_observaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_doctoblister, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel44))
                                                .addContainerGap())
                                        );

                                        jTabbedPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jTabbedPane1.border.title"))); // NOI18N
                                        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                                jTabbedPane1StateChanged(evt);
                                            }
                                        });

                                        jPanel1.setName("jPanel1"); // NOI18N

                                        jScrollPane1.setName("jScrollPane1"); // NOI18N

                                        jt_detallecompra.setModel(this.jtable_modelo_detalle);
                                        jt_detallecompra.setName("jt_detallecompra"); // NOI18N
                                        jt_detallecompra.setRowHeight(22);
                                        jt_detallecompra.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jt_detallecompraMouseClicked(evt);
                                                if(evt.getClickCount() >= 2)
                                                {
                                                    dioclick(evt);
                                                }
                                            }
                                        });
                                        jScrollPane1.setViewportView(jt_detallecompra);

                                        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
                                        jLabel14.setName("jLabel14"); // NOI18N

                                        jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
                                        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                                        jLabel13.setName("jLabel13"); // NOI18N

                                        buttonGroup1.add(jrbtn_columnaclave);
                                        jrbtn_columnaclave.setText(resourceMap.getString("jrbtn_columnaclave.text")); // NOI18N
                                        jrbtn_columnaclave.setActionCommand(resourceMap.getString("jrbtn_columnaclave.actionCommand")); // NOI18N
                                        jrbtn_columnaclave.setName("jrbtn_columnaclave"); // NOI18N
                                        jrbtn_columnaclave.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_columnaclaveActionPerformed(evt);
                                            }
                                        });

                                        buttonGroup1.add(jRadioButton1);
                                        jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
                                        jRadioButton1.setActionCommand(resourceMap.getString("jRadioButton1.actionCommand")); // NOI18N
                                        jRadioButton1.setName("jRadioButton1"); // NOI18N
                                        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jRadioButton1ActionPerformed(evt);
                                            }
                                        });

                                        buttonGroup1.add(jrbtn_item);
                                        jrbtn_item.setText(resourceMap.getString("jrbtn_item.text")); // NOI18N
                                        jrbtn_item.setActionCommand(resourceMap.getString("jrbtn_item.actionCommand")); // NOI18N
                                        jrbtn_item.setName("jrbtn_item"); // NOI18N
                                        jrbtn_item.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_itemActionPerformed(evt);
                                            }
                                        });

                                        jLabel15.setFont(resourceMap.getFont("jLabel15.font")); // NOI18N
                                        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
                                        jLabel15.setName("jLabel15"); // NOI18N

                                        jtf_buscarenjtable.setName("jtf_buscarenjtable"); // NOI18N
                                        jtf_buscarenjtable.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_buscarenjtableActionPerformed(evt);
                                            }
                                        });

                                        jlb_resultado.setFont(resourceMap.getFont("jlb_resultado.font")); // NOI18N
                                        jlb_resultado.setText(resourceMap.getString("jlb_resultado.text")); // NOI18N
                                        jlb_resultado.setName("jlb_resultado"); // NOI18N

                                        jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
                                        jCheckBox1.setName("jCheckBox1"); // NOI18N
                                        jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jCheckBox1ActionPerformed(evt);
                                            }
                                        });

                                        jPanel10.setName("jPanel10"); // NOI18N

                                        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
                                        jLabel9.setName("jLabel9"); // NOI18N

                                        jtf_totalpiezas.setEditable(false);
                                        jtf_totalpiezas.setFont(resourceMap.getFont("jtf_totalpiezas.font")); // NOI18N
                                        jtf_totalpiezas.setText(resourceMap.getString("jtf_totalpiezas.text")); // NOI18N
                                        jtf_totalpiezas.setName("jtf_totalpiezas"); // NOI18N

                                        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
                                        jLabel22.setName("jLabel22"); // NOI18N

                                        jtf_doctosubtotal.setEditable(false);
                                        jtf_doctosubtotal.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctosubtotal.setName("jtf_doctosubtotal"); // NOI18N

                                        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
                                        jLabel23.setName("jLabel23"); // NOI18N

                                        jtf_doctodesc.setEditable(false);
                                        jtf_doctodesc.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctodesc.setName("jtf_doctodesc"); // NOI18N

                                        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
                                        jLabel24.setName("jLabel24"); // NOI18N

                                        jtf_doctoimp.setEditable(false);
                                        jtf_doctoimp.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctoimp.setName("jtf_doctoimp"); // NOI18N

                                        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
                                        jLabel25.setName("jLabel25"); // NOI18N

                                        jtf_doctototal.setEditable(false);
                                        jtf_doctototal.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototal.setName("jtf_doctototal"); // NOI18N

                                        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
                                        jLabel26.setName("jLabel26"); // NOI18N

                                        jtf_doctototalpd.setEditable(false);
                                        jtf_doctototalpd.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototalpd.setName("jtf_doctototalpd"); // NOI18N

                                        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
                                        jLabel28.setName("jLabel28"); // NOI18N

                                        jtf_doctosubtotal1.setEditable(false);
                                        jtf_doctosubtotal1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctosubtotal1.setName("jtf_doctosubtotal1"); // NOI18N

                                        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
                                        jLabel29.setName("jLabel29"); // NOI18N

                                        jtf_doctodesc1.setEditable(false);
                                        jtf_doctodesc1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctodesc1.setName("jtf_doctodesc1"); // NOI18N

                                        jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
                                        jLabel30.setName("jLabel30"); // NOI18N

                                        jtf_doctoimp1.setEditable(false);
                                        jtf_doctoimp1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctoimp1.setName("jtf_doctoimp1"); // NOI18N

                                        jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
                                        jLabel31.setName("jLabel31"); // NOI18N

                                        jtf_doctototal1.setEditable(false);
                                        jtf_doctototal1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototal1.setName("jtf_doctototal1"); // NOI18N

                                        jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
                                        jLabel32.setName("jLabel32"); // NOI18N

                                        jtf_doctototalpd1.setEditable(false);
                                        jtf_doctototalpd1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototalpd1.setName("jtf_doctototalpd1"); // NOI18N

                                        jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
                                        jLabel33.setName("jLabel33"); // NOI18N

                                        jtf_totalpiezasdif.setEditable(false);
                                        jtf_totalpiezasdif.setFont(resourceMap.getFont("jtf_totalpiezasdif.font")); // NOI18N
                                        jtf_totalpiezasdif.setName("jtf_totalpiezasdif"); // NOI18N

                                        jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
                                        jLabel34.setName("jLabel34"); // NOI18N

                                        jtf_costodif.setEditable(false);
                                        jtf_costodif.setFont(resourceMap.getFont("jtf_costodif.font")); // NOI18N
                                        jtf_costodif.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_costodif.setName("jtf_costodif"); // NOI18N
                                        jtf_costodif.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_costodifActionPerformed(evt);
                                            }
                                        });

                                        jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
                                        jLabel35.setName("jLabel35"); // NOI18N

                                        jtf_totalpiezas1.setEditable(false);
                                        jtf_totalpiezas1.setFont(resourceMap.getFont("jtf_totalpiezas1.font")); // NOI18N
                                        jtf_totalpiezas1.setName("jtf_totalpiezas1"); // NOI18N

                                        jLabel36.setText(resourceMap.getString("jLabel36.text")); // NOI18N
                                        jLabel36.setName("jLabel36"); // NOI18N

                                        jtf_costodif1.setEditable(false);
                                        jtf_costodif1.setFont(resourceMap.getFont("jtf_costodif1.font")); // NOI18N
                                        jtf_costodif1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_costodif1.setName("jtf_costodif1"); // NOI18N
                                        jtf_costodif1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_costodif1ActionPerformed(evt);
                                            }
                                        });

                                        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                                        jPanel10.setLayout(jPanel10Layout);
                                        jPanel10Layout.setHorizontalGroup(
                                            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                .addGap(8, 8, 8)
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jLabel33)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                                .addComponent(jtf_totalpiezasdif, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jLabel34)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jtf_costodif, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                                .addComponent(jLabel36, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                .addGap(18, 18, 18)
                                                                .addComponent(jtf_costodif1, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel35)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_totalpiezas1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jLabel9)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jLabel22)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctosubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel23)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctodesc, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel24)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctoimp, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel25)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctototal, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jLabel28)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctosubtotal1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel29)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctodesc1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel30)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctoimp1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel31)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_doctototal1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                .addGap(18, 18, 18)
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel26)
                                                    .addComponent(jLabel32))
                                                .addGap(19, 19, 19)
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(jtf_doctototalpd1)
                                                    .addComponent(jtf_doctototalpd, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE))
                                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        );
                                        jPanel10Layout.setVerticalGroup(
                                            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel10Layout.createSequentialGroup()
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addContainerGap()
                                                        .addComponent(jtf_doctototalpd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                                                        .addComponent(jtf_doctototalpd1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                                        .addGap(13, 13, 13)
                                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel22)
                                                            .addComponent(jtf_doctosubtotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel23)
                                                            .addComponent(jtf_doctodesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel24)
                                                            .addComponent(jtf_doctoimp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel25)
                                                            .addComponent(jtf_doctototal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel9)
                                                            .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel33)
                                                            .addComponent(jtf_totalpiezasdif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_costodif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel34))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel28)
                                                            .addComponent(jtf_doctosubtotal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel29)
                                                            .addComponent(jtf_doctodesc1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel30)
                                                            .addComponent(jtf_doctoimp1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel31)
                                                            .addComponent(jtf_doctototal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel35)
                                                            .addComponent(jtf_totalpiezas1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_costodif1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jLabel36)))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                                        .addGap(19, 19, 19)
                                                        .addComponent(jLabel26)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
                                                        .addComponent(jLabel32)))
                                                .addContainerGap())
                                        );

                                        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                        jPanel1.setLayout(jPanel1Layout);
                                        jPanel1Layout.setHorizontalGroup(
                                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jLabel14)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel13)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jrbtn_columnaclave)
                                                .addGap(9, 9, 9)
                                                .addComponent(jRadioButton1)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jrbtn_item)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel15)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(jlb_resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jCheckBox1)
                                                .addContainerGap())
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                .addContainerGap(13, Short.MAX_VALUE)
                                                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap())
                                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                        );
                                        jPanel1Layout.setVerticalGroup(
                                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel14)
                                                    .addComponent(jLabel13)
                                                    .addComponent(jrbtn_columnaclave)
                                                    .addComponent(jRadioButton1)
                                                    .addComponent(jtf_buscarenjtable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jlb_resultado)
                                                    .addComponent(jLabel15)
                                                    .addComponent(jrbtn_item)
                                                    .addComponent(jCheckBox1))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

                                        jPanel2.setName("jPanel2"); // NOI18N

                                        jScrollPane3.setName("jScrollPane3"); // NOI18N

                                        jtbl_distribucion.setModel(this.jtable_modelo_distribucion);
                                        jtbl_distribucion.setName("jtbl_distribucion"); // NOI18N
                                        jtbl_distribucion.setRowHeight(22);
                                        jtbl_distribucion.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jtbl_distribucionMouseClicked(evt);
                                                if(evt.getClickCount() >= 2)
                                                {
                                                    dioclickd(evt);
                                                }
                                                if(evt.getClickCount() >= 1)
                                                {
                                                    dioclickdu(evt);
                                                }
                                            }
                                        });
                                        jScrollPane3.setViewportView(jtbl_distribucion);

                                        jchk_graficadistribucion.setText(resourceMap.getString("jchk_graficadistribucion.text")); // NOI18N
                                        jchk_graficadistribucion.setName("jchk_graficadistribucion"); // NOI18N
                                        jchk_graficadistribucion.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jchk_graficadistribucionActionPerformed(evt);
                                            }
                                        });

                                        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
                                        jLabel16.setName("jLabel16"); // NOI18N

                                        jLabel17.setFont(resourceMap.getFont("jLabel17.font")); // NOI18N
                                        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
                                        jLabel17.setName("jLabel17"); // NOI18N

                                        buttonGroup2.add(jrbtn_columnaclave1);
                                        jrbtn_columnaclave1.setText(resourceMap.getString("jrbtn_columnaclave1.text")); // NOI18N
                                        jrbtn_columnaclave1.setActionCommand(resourceMap.getString("jrbtn_columnaclave1.actionCommand")); // NOI18N
                                        jrbtn_columnaclave1.setName("jrbtn_columnaclave1"); // NOI18N
                                        jrbtn_columnaclave1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_columnaclave1ActionPerformed(evt);
                                            }
                                        });

                                        buttonGroup2.add(jrbtn_item1);
                                        jrbtn_item1.setText(resourceMap.getString("jrbtn_item1.text")); // NOI18N
                                        jrbtn_item1.setActionCommand(resourceMap.getString("jrbtn_item1.actionCommand")); // NOI18N
                                        jrbtn_item1.setName("jrbtn_item1"); // NOI18N
                                        jrbtn_item1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_item1ActionPerformed(evt);
                                            }
                                        });

                                        jLabel18.setFont(resourceMap.getFont("jLabel18.font")); // NOI18N
                                        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
                                        jLabel18.setName("jLabel18"); // NOI18N

                                        jtf_buscarenjtable1.setName("jtf_buscarenjtable1"); // NOI18N
                                        jtf_buscarenjtable1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_buscarenjtable1ActionPerformed(evt);
                                            }
                                        });

                                        jlb_resultado1.setFont(resourceMap.getFont("jlb_resultado1.font")); // NOI18N
                                        jlb_resultado1.setText(resourceMap.getString("jlb_resultado1.text")); // NOI18N
                                        jlb_resultado1.setName("jlb_resultado1"); // NOI18N

                                        jButton1.setIcon(resourceMap.getIcon("jButton1.icon")); // NOI18N
                                        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
                                        jButton1.setName("jButton1"); // NOI18N
                                        jButton1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jButton1ActionPerformed(evt);
                                            }
                                        });

                                        jtf_doctototal3.setEditable(false);
                                        jtf_doctototal3.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototal3.setName("jtf_doctototal3"); // NOI18N

                                        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                        jPanel2.setLayout(jPanel2Layout);
                                        jPanel2Layout.setHorizontalGroup(
                                            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addComponent(jchk_graficadistribucion)
                                                .addGap(18, 18, 18)
                                                .addComponent(jLabel16)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel17)
                                                .addGap(45, 45, 45)
                                                .addComponent(jrbtn_columnaclave1)
                                                .addGap(18, 18, 18)
                                                .addComponent(jrbtn_item1)
                                                .addGap(33, 33, 33)
                                                .addComponent(jLabel18)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(jlb_resultado1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(112, Short.MAX_VALUE))
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addGap(324, 324, 324)
                                                .addComponent(jButton1)
                                                .addGap(36, 36, 36)
                                                .addComponent(jtf_doctototal3, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(452, Short.MAX_VALUE))
                                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                        );
                                        jPanel2Layout.setVerticalGroup(
                                            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jchk_graficadistribucion)
                                                    .addComponent(jLabel16)
                                                    .addComponent(jLabel17)
                                                    .addComponent(jtf_buscarenjtable1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jlb_resultado1)
                                                    .addComponent(jLabel18)
                                                    .addComponent(jrbtn_item1)
                                                    .addComponent(jrbtn_columnaclave1))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 395, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jButton1)
                                                    .addComponent(jtf_doctototal3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addContainerGap(21, Short.MAX_VALUE))
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

                                        jPanel4.setName("jPanel4"); // NOI18N

                                        jScrollPane4.setName("jScrollPane4"); // NOI18N

                                        jtbl_distribucionfotos.setModel(this.jtable_modelo_fotos);
                                        jtbl_distribucionfotos.setName("jtbl_distribucionfotos"); // NOI18N
                                        jtbl_distribucionfotos.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jtbl_distribucionfotosMouseClicked(evt);
                                                if(evt.getClickCount() >= 2)
                                                {
                                                    dioclickf(evt);
                                                }
                                            }
                                        });
                                        jScrollPane4.setViewportView(jtbl_distribucionfotos);

                                        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
                                        jLabel19.setName("jLabel19"); // NOI18N

                                        jLabel20.setFont(resourceMap.getFont("jLabel20.font")); // NOI18N
                                        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
                                        jLabel20.setName("jLabel20"); // NOI18N

                                        buttonGroup3.add(jrbtn_columnaclave2);
                                        jrbtn_columnaclave2.setText(resourceMap.getString("jrbtn_columnaclave2.text")); // NOI18N
                                        jrbtn_columnaclave2.setActionCommand(resourceMap.getString("jrbtn_columnaclave2.actionCommand")); // NOI18N
                                        jrbtn_columnaclave2.setName("jrbtn_columnaclave2"); // NOI18N
                                        jrbtn_columnaclave2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_columnaclave2ActionPerformed(evt);
                                            }
                                        });

                                        buttonGroup3.add(jRadioButton2);
                                        jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
                                        jRadioButton2.setActionCommand(resourceMap.getString("jRadioButton2.actionCommand")); // NOI18N
                                        jRadioButton2.setName("jRadioButton2"); // NOI18N
                                        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jRadioButton2ActionPerformed(evt);
                                            }
                                        });

                                        buttonGroup3.add(jrbtn_item2);
                                        jrbtn_item2.setText(resourceMap.getString("jrbtn_item2.text")); // NOI18N
                                        jrbtn_item2.setActionCommand(resourceMap.getString("jrbtn_item2.actionCommand")); // NOI18N
                                        jrbtn_item2.setName("jrbtn_item2"); // NOI18N
                                        jrbtn_item2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jrbtn_item2ActionPerformed(evt);
                                            }
                                        });

                                        jLabel21.setFont(resourceMap.getFont("jLabel21.font")); // NOI18N
                                        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
                                        jLabel21.setName("jLabel21"); // NOI18N

                                        jtf_buscarenjtable2.setName("jtf_buscarenjtable2"); // NOI18N
                                        jtf_buscarenjtable2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jtf_buscarenjtable2ActionPerformed(evt);
                                            }
                                        });

                                        jlb_resultado2.setFont(resourceMap.getFont("jlb_resultado2.font")); // NOI18N
                                        jlb_resultado2.setText(resourceMap.getString("jlb_resultado2.text")); // NOI18N
                                        jlb_resultado2.setName("jlb_resultado2"); // NOI18N

                                        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                        jPanel4.setLayout(jPanel4Layout);
                                        jPanel4Layout.setHorizontalGroup(
                                            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addComponent(jLabel19)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel20)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jrbtn_columnaclave2)
                                                .addGap(9, 9, 9)
                                                .addComponent(jRadioButton2)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jrbtn_item2)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel21)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_buscarenjtable2, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(jlb_resultado2, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(267, Short.MAX_VALUE))
                                            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                        );
                                        jPanel4Layout.setVerticalGroup(
                                            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel19)
                                                    .addComponent(jLabel20)
                                                    .addComponent(jrbtn_columnaclave2)
                                                    .addComponent(jRadioButton2)
                                                    .addComponent(jtf_buscarenjtable2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jlb_resultado2)
                                                    .addComponent(jLabel21)
                                                    .addComponent(jrbtn_item2))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 457, Short.MAX_VALUE))
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

                                        jPanel5.setName("jPanel5"); // NOI18N

                                        jScrollPane5.setName("jScrollPane5"); // NOI18N

                                        jtbl_recepciones.setModel(this.jtable_modelo);
                                        jtbl_recepciones.setName("jtbl_recepciones"); // NOI18N
                                        jtbl_recepciones.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jtbl_recepcionesMouseClicked(evt);
                                                if(evt.getClickCount() >= 2)
                                                {
                                                    dioclickr(evt);
                                                }
                                                if(evt.getClickCount() == 1)
                                                {
                                                    dioclickgenven(evt);
                                                }
                                            }
                                        });
                                        jScrollPane5.setViewportView(jtbl_recepciones);

                                        jbtn_cargardistribucionxclie.setIcon(resourceMap.getIcon("jbtn_cargardistribucionxclie.icon")); // NOI18N
                                        jbtn_cargardistribucionxclie.setText(resourceMap.getString("jbtn_cargardistribucionxclie.text")); // NOI18N
                                        jbtn_cargardistribucionxclie.setName("jbtn_cargardistribucionxclie"); // NOI18N
                                        jbtn_cargardistribucionxclie.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_cargardistribucionxclieActionPerformed(evt);
                                            }
                                        });

                                        jtf_idcliente.setEditable(false);
                                        jtf_idcliente.setText(resourceMap.getString("jtf_idcliente.text")); // NOI18N
                                        jtf_idcliente.setName("jtf_idcliente"); // NOI18N

                                        jtf_describecliente.setEditable(false);
                                        jtf_describecliente.setText(resourceMap.getString("jtf_describecliente.text")); // NOI18N
                                        jtf_describecliente.setName("jtf_describecliente"); // NOI18N

                                        jtf_pzasdistri.setEditable(false);
                                        jtf_pzasdistri.setText(resourceMap.getString("jtf_pzasdistri.text")); // NOI18N
                                        jtf_pzasdistri.setName("jtf_pzasdistri"); // NOI18N

                                        jbtn_generarventa.setIcon(resourceMap.getIcon("jbtn_generarventa.icon")); // NOI18N
                                        jbtn_generarventa.setText(resourceMap.getString("jbtn_generarventa.text")); // NOI18N
                                        jbtn_generarventa.setName("jbtn_generarventa"); // NOI18N
                                        jbtn_generarventa.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_generarventaActionPerformed(evt);
                                            }
                                        });

                                        jtf_idffila.setEditable(false);
                                        jtf_idffila.setName("jtf_idffila"); // NOI18N

                                        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel14.border.title"))); // NOI18N
                                        jPanel14.setName("jPanel14"); // NOI18N

                                        jLabel42.setText(resourceMap.getString("jLabel42.text")); // NOI18N
                                        jLabel42.setName("jLabel42"); // NOI18N

                                        jtf_observa_update.setName("jtf_observa_update"); // NOI18N

                                        jbtn_actualizar.setIcon(resourceMap.getIcon("jbtn_actualizar.icon")); // NOI18N
                                        jbtn_actualizar.setText(resourceMap.getString("jbtn_actualizar.text")); // NOI18N
                                        jbtn_actualizar.setToolTipText(resourceMap.getString("jbtn_actualizar.toolTipText")); // NOI18N
                                        jbtn_actualizar.setName("jbtn_actualizar"); // NOI18N
                                        jbtn_actualizar.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_actualizarActionPerformed(evt);
                                            }
                                        });

                                        tf_foliodoctoanteriorupda.setFont(resourceMap.getFont("tf_foliodoctoanteriorupda.font")); // NOI18N
                                        tf_foliodoctoanteriorupda.setName("tf_foliodoctoanteriorupda"); // NOI18N
                                        tf_foliodoctoanteriorupda.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_foliodoctoanteriorupdaActionPerformed(evt);
                                            }
                                        });

                                        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                                        jLabel11.setName("jLabel11"); // NOI18N

                                        jbtn_actualizar1.setIcon(resourceMap.getIcon("jbtn_actualizar1.icon")); // NOI18N
                                        jbtn_actualizar1.setText(resourceMap.getString("jbtn_actualizar1.text")); // NOI18N
                                        jbtn_actualizar1.setToolTipText(resourceMap.getString("jbtn_actualizar1.toolTipText")); // NOI18N
                                        jbtn_actualizar1.setName("jbtn_actualizar1"); // NOI18N
                                        jbtn_actualizar1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_actualizar1ActionPerformed(evt);
                                            }
                                        });

                                        jLabel43.setText(resourceMap.getString("jLabel43.text")); // NOI18N
                                        jLabel43.setName("jLabel43"); // NOI18N

                                        tf_foliodoctoanteriorupda1.setFont(resourceMap.getFont("tf_foliodoctoanteriorupda1.font")); // NOI18N
                                        tf_foliodoctoanteriorupda1.setName("tf_foliodoctoanteriorupda1"); // NOI18N
                                        tf_foliodoctoanteriorupda1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_foliodoctoanteriorupda1ActionPerformed(evt);
                                            }
                                        });

                                        jbtn_actualizar2.setText(resourceMap.getString("jbtn_actualizar2.text")); // NOI18N
                                        jbtn_actualizar2.setToolTipText(resourceMap.getString("jbtn_actualizar2.toolTipText")); // NOI18N
                                        jbtn_actualizar2.setName("jbtn_actualizar2"); // NOI18N
                                        jbtn_actualizar2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_actualizar2ActionPerformed(evt);
                                            }
                                        });

                                        tf_foliotienda.setEditable(false);
                                        tf_foliotienda.setFont(resourceMap.getFont("tf_foliotienda.font")); // NOI18N
                                        tf_foliotienda.setText(resourceMap.getString("tf_foliotienda.text")); // NOI18N
                                        tf_foliotienda.setName("tf_foliotienda"); // NOI18N
                                        tf_foliotienda.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_foliotiendaActionPerformed(evt);
                                            }
                                        });

                                        tf_foliotienda1.setEditable(false);
                                        tf_foliotienda1.setFont(resourceMap.getFont("tf_foliotienda1.font")); // NOI18N
                                        tf_foliotienda1.setText(resourceMap.getString("tf_foliotienda1.text")); // NOI18N
                                        tf_foliotienda1.setName("tf_foliotienda1"); // NOI18N
                                        tf_foliotienda1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                tf_foliotienda1ActionPerformed(evt);
                                            }
                                        });

                                        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
                                        jPanel14.setLayout(jPanel14Layout);
                                        jPanel14Layout.setHorizontalGroup(
                                            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addComponent(jLabel43)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_foliodoctoanteriorupda1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jbtn_actualizar2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addComponent(jLabel11)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_foliodoctoanteriorupda, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel42)))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addComponent(jtf_observa_update, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jbtn_actualizar))
                                                    .addGroup(jPanel14Layout.createSequentialGroup()
                                                        .addComponent(tf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(tf_foliotienda1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jbtn_actualizar1))))
                                        );
                                        jPanel14Layout.setVerticalGroup(
                                            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                .addContainerGap(66, Short.MAX_VALUE)
                                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel43, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(tf_foliodoctoanteriorupda1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jbtn_actualizar2))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                                                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jbtn_actualizar1)
                                                            .addComponent(tf_foliotienda1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(tf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGap(22, 22, 22)))
                                                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(tf_foliodoctoanteriorupda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel42)
                                                    .addComponent(jtf_observa_update, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jbtn_actualizar)))
                                        );

                                        jbtn_generarventa1.setIcon(resourceMap.getIcon("jbtn_generarventa1.icon")); // NOI18N
                                        jbtn_generarventa1.setText(resourceMap.getString("jbtn_generarventa1.text")); // NOI18N
                                        jbtn_generarventa1.setName("jbtn_generarventa1"); // NOI18N
                                        jbtn_generarventa1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_generarventa1ActionPerformed(evt);
                                            }
                                        });

                                        jtf_totalletras.setText(resourceMap.getString("jtf_totalletras.text")); // NOI18N
                                        jtf_totalletras.setName("jtf_totalletras"); // NOI18N

                                        jbtn_imprimirdetalle.setIcon(resourceMap.getIcon("jbtn_imprimirdetalle.icon")); // NOI18N
                                        jbtn_imprimirdetalle.setText(resourceMap.getString("jbtn_imprimirdetalle.text")); // NOI18N
                                        jbtn_imprimirdetalle.setName("jbtn_imprimirdetalle"); // NOI18N
                                        jbtn_imprimirdetalle.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_imprimirdetalleActionPerformed(evt);
                                            }
                                        });

                                        jtf_idcliente1.setEditable(false);
                                        jtf_idcliente1.setFont(resourceMap.getFont("jtf_idcliente1.font")); // NOI18N
                                        jtf_idcliente1.setText(resourceMap.getString("jtf_idcliente1.text")); // NOI18N
                                        jtf_idcliente1.setName("jtf_idcliente1"); // NOI18N

                                        jtf_describecliente1.setEditable(false);
                                        jtf_describecliente1.setFont(resourceMap.getFont("jtf_describecliente1.font")); // NOI18N
                                        jtf_describecliente1.setName("jtf_describecliente1"); // NOI18N

                                        jbtn_generarventa2.setIcon(resourceMap.getIcon("jbtn_generarventa2.icon")); // NOI18N
                                        jbtn_generarventa2.setText(resourceMap.getString("jbtn_generarventa2.text")); // NOI18N
                                        jbtn_generarventa2.setName("jbtn_generarventa2"); // NOI18N
                                        jbtn_generarventa2.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_generarventa2ActionPerformed(evt);
                                            }
                                        });

                                        jtf_pzasdistri1.setEditable(false);
                                        jtf_pzasdistri1.setName("jtf_pzasdistri1"); // NOI18N

                                        jScrollPane8.setName("jScrollPane8"); // NOI18N

                                        jlst_clientesdistribucion.setFont(resourceMap.getFont("jlst_clientesdistribucion.font")); // NOI18N
                                        jlst_clientesdistribucion.setModel(this.modelo);
                                        jlst_clientesdistribucion.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
                                        jlst_clientesdistribucion.setName("jlst_clientesdistribucion"); // NOI18N
                                        jlst_clientesdistribucion.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jlst_clientesdistribucionMouseClicked(evt);
                                                if(evt.getClickCount() >= 1)
                                                {
                                                    dioclick_disuni(evt);
                                                }
                                            }
                                        });
                                        jScrollPane8.setViewportView(jlst_clientesdistribucion);

                                        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                        jPanel5.setLayout(jPanel5Layout);
                                        jPanel5Layout.setHorizontalGroup(
                                            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                            .addGroup(jPanel5Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jbtn_imprimirdetalle)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_totalletras, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_idffila, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_idcliente, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_describecliente, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_pzasdistri, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_pzasdistri1, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jbtn_generarventa)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jbtn_generarventa1)
                                                .addContainerGap())
                                            .addGroup(jPanel5Layout.createSequentialGroup()
                                                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jbtn_generarventa2)
                                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                                        .addComponent(jtf_idcliente1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_describecliente1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addComponent(jbtn_cargardistribucionxclie))
                                                .addGap(27, 27, 27)
                                                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap())
                                        );
                                        jPanel5Layout.setVerticalGroup(
                                            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel5Layout.createSequentialGroup()
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jbtn_imprimirdetalle)
                                                    .addComponent(jtf_totalletras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_idffila, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_idcliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_describecliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_pzasdistri, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jbtn_generarventa1)
                                                    .addComponent(jbtn_generarventa)
                                                    .addComponent(jtf_pzasdistri1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE)
                                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                                        .addComponent(jbtn_cargardistribucionxclie)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                                                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jtf_idcliente1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_describecliente1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jbtn_generarventa2)
                                                        .addGap(26, 26, 26))
                                                    .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                .addContainerGap())
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

                                        jPanel6.setName("jPanel6"); // NOI18N

                                        jScrollPane6.setName("jScrollPane6"); // NOI18N

                                        jt_detallecomprasae.setModel(this.jtable_modelo_detalle_exp);
                                        jt_detallecomprasae.setName("jt_detallecomprasae"); // NOI18N
                                        jt_detallecomprasae.setRowHeight(22);
                                        jScrollPane6.setViewportView(jt_detallecomprasae);

                                        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                        jPanel6.setLayout(jPanel6Layout);
                                        jPanel6Layout.setHorizontalGroup(
                                            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGap(0, 1046, Short.MAX_VALUE)
                                            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE))
                                        );
                                        jPanel6Layout.setVerticalGroup(
                                            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGap(0, 484, Short.MAX_VALUE)
                                            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel6Layout.createSequentialGroup()
                                                    .addContainerGap()
                                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE)))
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

                                        jPanel7.setName("jPanel7"); // NOI18N

                                        jPanel8.setName("jPanel8"); // NOI18N

                                        jScrollPane11.setName("jScrollPane11"); // NOI18N

                                        jep_articuloimagen.setContentType(resourceMap.getString("jep_articuloimagen.contentType")); // NOI18N
                                        jep_articuloimagen.setName("jep_articuloimagen"); // NOI18N
                                        jScrollPane11.setViewportView(jep_articuloimagen);

                                        jtf_idarticulo_fotostock.setFont(resourceMap.getFont("jtf_idarticulo_fotostock.font")); // NOI18N
                                        jtf_idarticulo_fotostock.setText(resourceMap.getString("jtf_idarticulo_fotostock.text")); // NOI18N
                                        jtf_idarticulo_fotostock.setName("jtf_idarticulo_fotostock"); // NOI18N

                                        jbtn_imagenfull.setFont(resourceMap.getFont("jbtn_imagenfull.font")); // NOI18N
                                        jbtn_imagenfull.setIcon(resourceMap.getIcon("jbtn_imagenfull.icon")); // NOI18N
                                        jbtn_imagenfull.setText(resourceMap.getString("jbtn_imagenfull.text")); // NOI18N
                                        jbtn_imagenfull.setToolTipText(resourceMap.getString("jbtn_imagenfull.toolTipText")); // NOI18N
                                        jbtn_imagenfull.setName("jbtn_imagenfull"); // NOI18N
                                        jbtn_imagenfull.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jbtn_imagenfullActionPerformed(evt);
                                            }
                                        });

                                        jtf_fotoidstocks2.setFont(resourceMap.getFont("jtf_fotoidstocks2.font")); // NOI18N
                                        jtf_fotoidstocks2.setName("jtf_fotoidstocks2"); // NOI18N

                                        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                        jPanel8.setLayout(jPanel8Layout);
                                        jPanel8Layout.setHorizontalGroup(
                                            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel8Layout.createSequentialGroup()
                                                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jbtn_imagenfull)
                                                    .addComponent(jtf_idarticulo_fotostock, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jtf_fotoidstocks2, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addContainerGap())
                                        );
                                        jPanel8Layout.setVerticalGroup(
                                            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                                            .addGroup(jPanel8Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jtf_idarticulo_fotostock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(28, 28, 28)
                                                .addComponent(jbtn_imagenfull)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                                                .addComponent(jtf_fotoidstocks2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        );

                                        jPanel9.setName("jPanel9"); // NOI18N

                                        jScrollPane7.setName("jScrollPane7"); // NOI18N

                                        jtb_catalogo_artiexis.setModel(this.jtable_modelo_existencias);
                                        jtb_catalogo_artiexis.setName("jtb_catalogo_artiexis"); // NOI18N
                                        jtb_catalogo_artiexis.setRowHeight(22);
                                        jtb_catalogo_artiexis.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jtb_catalogo_artiexisMouseClicked(evt);
                                                if(evt.getClickCount() >= 1)
                                                {
                                                    dioclickidartideta(evt);
                                                    //System.out.println(" double click" );

                                                }
                                            }
                                        });
                                        jScrollPane7.setViewportView(jtb_catalogo_artiexis);

                                        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                                        jPanel9.setLayout(jPanel9Layout);
                                        jPanel9Layout.setHorizontalGroup(
                                            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                        );
                                        jPanel9Layout.setVerticalGroup(
                                            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        );

                                        jPanel24.setName("jPanel24"); // NOI18N

                                        jScrollPane16.setName("jScrollPane16"); // NOI18N

                                        System.out.println("esta inicializando estadistica");
                                        jtbl_estadisticasarticulo1.setModel(this.jtable_modelo_estadisticas);
                                        jtbl_estadisticasarticulo1.setName("jtbl_estadisticasarticulo1"); // NOI18N
                                        jtbl_estadisticasarticulo1.setRowHeight(26);
                                        jScrollPane16.setViewportView(jtbl_estadisticasarticulo1);

                                        javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
                                        jPanel24.setLayout(jPanel24Layout);
                                        jPanel24Layout.setHorizontalGroup(
                                            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 628, Short.MAX_VALUE)
                                        );
                                        jPanel24Layout.setVerticalGroup(
                                            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane16, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                                        );

                                        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                        jPanel7.setLayout(jPanel7Layout);
                                        jPanel7Layout.setHorizontalGroup(
                                            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jPanel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        );
                                        jPanel7Layout.setVerticalGroup(
                                            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jPanel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addContainerGap())
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

                                        jPanel11.setName("jPanel11"); // NOI18N

                                        jScrollPane2.setName("jScrollPane2"); // NOI18N

                                        jt_detallecompra1.setModel(this.jtable_modelo_detalled);
                                        jt_detallecompra1.setName("jt_detallecompra1"); // NOI18N
                                        jt_detallecompra1.setRowHeight(22);
                                        jt_detallecompra.addMouseListener(new java.awt.event.MouseAdapter() {
                                            public void mouseClicked(java.awt.event.MouseEvent evt) {
                                                jt_detallecompraMouseClicked(evt);
                                                if(evt.getClickCount() >= 2)
                                                {
                                                    dioclick(evt);
                                                }
                                            }
                                        });
                                        jScrollPane2.setViewportView(jt_detallecompra1);

                                        jLabel37.setText(resourceMap.getString("jLabel37.text")); // NOI18N
                                        jLabel37.setName("jLabel37"); // NOI18N

                                        jtf_totalpiezas2.setEditable(false);
                                        jtf_totalpiezas2.setFont(resourceMap.getFont("jtf_totalpiezas2.font")); // NOI18N
                                        jtf_totalpiezas2.setName("jtf_totalpiezas2"); // NOI18N

                                        jLabel38.setText(resourceMap.getString("jLabel38.text")); // NOI18N
                                        jLabel38.setName("jLabel38"); // NOI18N

                                        jtf_doctosubtotal2.setEditable(false);
                                        jtf_doctosubtotal2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctosubtotal2.setName("jtf_doctosubtotal2"); // NOI18N

                                        jLabel39.setText(resourceMap.getString("jLabel39.text")); // NOI18N
                                        jLabel39.setName("jLabel39"); // NOI18N

                                        jtf_doctodesc2.setEditable(false);
                                        jtf_doctodesc2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctodesc2.setName("jtf_doctodesc2"); // NOI18N

                                        jLabel40.setText(resourceMap.getString("jLabel40.text")); // NOI18N
                                        jLabel40.setName("jLabel40"); // NOI18N

                                        jtf_doctoimp2.setEditable(false);
                                        jtf_doctoimp2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctoimp2.setName("jtf_doctoimp2"); // NOI18N

                                        jLabel41.setText(resourceMap.getString("jLabel41.text")); // NOI18N
                                        jLabel41.setName("jLabel41"); // NOI18N

                                        jtf_doctototal2.setEditable(false);
                                        jtf_doctototal2.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
                                        jtf_doctototal2.setName("jtf_doctototal2"); // NOI18N

                                        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
                                        jPanel11.setLayout(jPanel11Layout);
                                        jPanel11Layout.setHorizontalGroup(
                                            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1046, Short.MAX_VALUE)
                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jLabel37)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_totalpiezas2, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel38)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_doctosubtotal2, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel39)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_doctodesc2, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel40)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_doctoimp2, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel41)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_doctototal2, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addContainerGap(446, Short.MAX_VALUE))
                                        );
                                        jPanel11Layout.setVerticalGroup(
                                            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel11Layout.createSequentialGroup()
                                                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE)
                                                .addGap(18, 18, 18)
                                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel38)
                                                    .addComponent(jtf_doctosubtotal2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel39)
                                                    .addComponent(jtf_doctodesc2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel40)
                                                    .addComponent(jtf_doctoimp2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel41)
                                                    .addComponent(jtf_doctototal2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel37)
                                                    .addComponent(jtf_totalpiezas2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(102, 102, 102))
                                        );

                                        jTabbedPane1.addTab(resourceMap.getString("jPanel11.TabConstraints.tabTitle"), jPanel11); // NOI18N

                                        jMenuBar1.setName("jMenuBar1"); // NOI18N

                                        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                        jMenu1.setName("jMenu1"); // NOI18N

                                        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
                                        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                        jmni_salir.setName("jmni_salir"); // NOI18N
                                        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_salirActionPerformed(evt);
                                            }
                                        });
                                        jMenu1.add(jmni_salir);

                                        jMenuBar1.add(jMenu1);

                                        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
                                        jMenu2.setName("jMenu2"); // NOI18N

                                        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                        jmni_escape.setName("jmni_escape"); // NOI18N
                                        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_escapeActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jmni_escape);

                                        jmni_imprimir.setText(resourceMap.getString("jmni_imprimir.text")); // NOI18N
                                        jmni_imprimir.setName("jmni_imprimir"); // NOI18N
                                        jmni_imprimir.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_imprimirActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jmni_imprimir);

                                        jmni_distribucion.setText(resourceMap.getString("jmni_distribucion.text")); // NOI18N
                                        jmni_distribucion.setName("jmni_distribucion"); // NOI18N
                                        jmni_distribucion.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_distribucionActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jmni_distribucion);

                                        jmni_foliotiendas.setText(resourceMap.getString("jmni_foliotiendas.text")); // NOI18N
                                        jmni_foliotiendas.setName("jmni_foliotiendas"); // NOI18N
                                        jmni_foliotiendas.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_foliotiendasActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jmni_foliotiendas);

                                        jmni_documentodif.setText(resourceMap.getString("jmni_documentodif.text")); // NOI18N
                                        jmni_documentodif.setName("jmni_documentodif"); // NOI18N
                                        jmni_documentodif.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jmni_documentodifActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jmni_documentodif);

                                        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
                                        jMenuItem1.setName("jMenuItem1"); // NOI18N
                                        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                                jMenuItem1ActionPerformed(evt);
                                            }
                                        });
                                        jMenu2.add(jMenuItem1);

                                        jMenuBar1.add(jMenu2);

                                        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                                        jMenu3.setName("jMenu3"); // NOI18N
                                        jMenuBar1.add(jMenu3);

                                        setJMenuBar(jMenuBar1);

                                        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                        getContentPane().setLayout(layout);
                                        layout.setHorizontalGroup(
                                            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1067, Short.MAX_VALUE)
                                        );
                                        layout.setVerticalGroup(
                                            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 542, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        );

                                        pack();
                                    }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0)
              {
                  this.dispose();
              }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jtf_idproveedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_idproveedorActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_idproveedorActionPerformed

    private void tf_foliodoctoanteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliodoctoanteriorActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_foliodoctoanteriorActionPerformed

    private void tf_fechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_fechaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_fechaActionPerformed

    private void tf_fechareferenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_fechareferenciaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_fechareferenciaActionPerformed

    private void tf_fecharecepcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_fecharecepcionActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_fecharecepcionActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
            indexactual=this.jTabbedPane1.getSelectedIndex();
           if((indexactual==1)&&(yacarguedistrialma==0))
            {
               yacarguedistrialma=1;
               this.carga_datos_distribucionalma(this.tf_foliodistribucion.getText().trim());
            }
            if((indexactual==2)&&(yacarguedistrifotos==0))
            {
               yacarguedistrifotos=1;
               this.distribucionfotos();
            }
            if((indexactual==3)&&(yacarguedistrirecepciones==0))
            {
               yacarguedistrirecepciones=1;
               this.carga_datos(7,this.tf_foliodistribucion.getText().trim());
            }
             if((indexactual==5)&&(yacarguestock==0))
            {
              yacarguestock=1;
                    if (controltiendas==0)
                            {
                                this.iniciar_modelo_tiendasexis();
                            }
                            this.verexistencias();
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jchk_graficadistribucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchk_graficadistribucionActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_distribuciontotal();
}//GEN-LAST:event_jchk_graficadistribucionActionPerformed

    private void jrbtn_columnaclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclaveActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_columnaclaveActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jrbtn_itemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_itemActionPerformed
        // TODO add your handling code here:
        columnavisualisa=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_itemActionPerformed

    private void jtf_buscarenjtableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtableActionPerformed
        // TODO add your handling code here:
        this.find_textoenjtable(columnavisualisa, 0, this.jtf_buscarenjtable.getText().toUpperCase().trim());
}//GEN-LAST:event_jtf_buscarenjtableActionPerformed

    private void jrbtn_columnaclave1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave1ActionPerformed
        // TODO add your handling code here:
                columnavisualisa2=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclave1ActionPerformed

    private void jrbtn_item1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item1ActionPerformed
        // TODO add your handling code here:
                columnavisualisa2=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_item1ActionPerformed

    private void jtf_buscarenjtable1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtable1ActionPerformed
        // TODO add your handling code here:
               this.find_textoenjtable2(columnavisualisa2, 0, this.jtf_buscarenjtable1.getText().toUpperCase().trim());
    }//GEN-LAST:event_jtf_buscarenjtable1ActionPerformed

    private void jrbtn_columnaclave2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_columnaclave2ActionPerformed
        // TODO add your handling code here:
         columnavisualisa3=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_columnaclave2ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa3=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jrbtn_item2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_item2ActionPerformed
        // TODO add your handling code here:
        columnavisualisa3=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_item2ActionPerformed

    private void jtf_buscarenjtable2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_buscarenjtable2ActionPerformed
        // TODO add your handling code here:
                       this.find_textoenjtable3(columnavisualisa3, 0, this.jtf_buscarenjtable2.getText().toUpperCase().trim());
    }//GEN-LAST:event_jtf_buscarenjtable2ActionPerformed

    private void jbtn_provestadisticaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_provestadisticaActionPerformed
        // TODO add your handling code here:
        String valor[]=this.jtf_idproveedor.getText().split(":");
        com_distri_compras_proveedores_edita fcdcpe=new com_distri_compras_proveedores_edita(valor[0]);
        fcdcpe.pack();
        fcdcpe.setVisible(true);
    }//GEN-LAST:event_jbtn_provestadisticaActionPerformed

    private void jbtn_cargardistribucionxclieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_cargardistribucionxclieActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Ver Distribucion x Cliente?")==0)
                {
                    this.carga_datos_distribucionxclie(this.tf_foliodistribucion.getText());
                }
        
    }//GEN-LAST:event_jbtn_cargardistribucionxclieActionPerformed

    private void jbtn_generarventaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generarventaActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null,"<html><h2>Proveedor:"+this.jtf_idproveedor.getText()+"<br>Desea Generar Venta para Cliente:? "+this.jtf_describecliente.getText()+"con<br>Total pieza="+this.jtf_pzasdistri.getText()+"<br>Importe Costo Proveedor:$"+this.jtf_pzasdistri1.getText()+"</html>")==0)
            {
                String idprov[]=this.jtf_idproveedor.getText().toString().split(":");
                String idcla[]=this.jtf_viaje.getText().toString().split(":");
                int retorno=0;
                String texto="select * from x1distribucion_terminados_ventas_agregarv3(1,'"+this.tf_foliodistribucion.getText()+"','1','"+this.jtf_idcliente.getText()+"','"+idprov[0]+"','"+idcla[0]+"','"+this.tf_foliodoctoanterior.getText()+"','"+this.fechaamericana(this.tf_fechareferencia.getText())+"');";
                System.out.println(texto);
                try
                   {
                   rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                   while (rs.next())
                       {
                           retorno=rs.getInt(1);
                       }
                   }
                    catch(Exception e)
                        {
                            System.out.println(e.getMessage());
                        }
                    if (retorno>0)
                        {
                            this.jbtn_generarventa.setVisible(false);
                            jtable_modelo.setValueAt(retorno,Integer.valueOf(this.jtf_idffila.getText()) ,0);
                            JOptionPane.showMessageDialog(null," Folio "+retorno+" Correcto", "Sistema Integral(Venta Alta) : Error",1);
                        }
        }

    }//GEN-LAST:event_jbtn_generarventaActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
        this.jtf_totalletras.setText(this.PesosMN(Float.valueOf(this.jtf_doctototal.getText().replace(",", ""))));
    }//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jbtn_imagenfullActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfullActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_idarticulo_fotostock.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
    }//GEN-LAST:event_jbtn_imagenfullActionPerformed

    private void jbtn_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos los Datos?")==0) {
            int folio=0;
            String textosql="select * from x1distribucion_terminados_entra_doctos_update(1,'"+this.tf_foliodistribucion.getText()+"','"+this.jtf_observa_update.getText().toUpperCase().trim()+"','"+this.tf_foliodoctoanteriorupda.getText().toUpperCase().trim()+"');";
            try {
                rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
                while (rs.next()) {
                    folio = rs.getInt(1);
                }
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
            if (folio==1) {
                this.jep_observaciones.setText(this.jtf_observa_update.getText().toUpperCase().trim());
                this.tf_foliodoctoanterior.setText(this.tf_foliodoctoanteriorupda.getText().toUpperCase().trim());
                JOptionPane.showMessageDialog(null,"Gracias Observacion Actualizada correctamente", "Sistema Integral: Entrada",1);
            } else {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
            }
        }
}//GEN-LAST:event_jbtn_actualizarActionPerformed

    private void tf_foliodoctoanteriorupdaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliodoctoanteriorupdaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_foliodoctoanteriorupdaActionPerformed

    private void jbtn_generarventa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generarventa1ActionPerformed
        // TODO add your handling code here:
            if(JOptionPane.showConfirmDialog(null, "Desea Generar Venta y Recepcionar?")==0)
            {
                String idprov[]=this.jtf_idproveedor.getText().toString().split(":");
                String idcla[]=this.jtf_viaje.getText().toString().split(":");
                int retorno=0;
                String texto="select * from x1distribucion_terminados_ventas_agregarv2(1,'"+this.tf_foliodistribucion.getText()+"','1','"+this.jtf_idcliente.getText()+"','"+idprov[0]+"','"+idcla[0]+"');";
                System.out.println(texto);
                try
                   {
                   rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                   while (rs.next())
                       {
                           retorno=rs.getInt(1);
                       }
                   }
                    catch(Exception e)
                        {
                            System.out.println(e.getMessage());
                        }
                    if (retorno>0)
                        {
                            this.jbtn_generarventa.setVisible(false);
                            jtable_modelo.setValueAt(retorno,Integer.valueOf(this.jtf_idffila.getText()) ,0);
                            JOptionPane.showMessageDialog(null," Folio "+retorno+" Correcto", "Sistema Integral(Venta Alta) : Error",1);
                     

                   try
                            {
                                rs = x.sieuno_executediversosv2("select * from x1distribucion_ventas_add_sieuno('"+ retorno+"') as (status smallint)",variables_global.getconexiongral());
                                while (rs.next())
                                    {
                                        if (Integer.valueOf(rs.getString(1)) < 3)
                                            {
                                            JOptionPane.showMessageDialog(null," Recepcion Correcta, Gracias", "Sistema Integral(Detalle Recepcion) : Confirmacion",1);
                                            }
                                        else
                                            {
                                                  JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Detalle Recepcion) : Error",1);
                                            }
                                    }

                            }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                    JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Detalle Recepcion) : Error",1);
                                }
                }


                }



    }//GEN-LAST:event_jbtn_generarventa1ActionPerformed

    private void jmni_imprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_imprimirActionPerformed
        // TODO add your handling code here:
        float filas = this.jtable_modelo_detalle.getRowCount() ;
        float paginas = filas /50;
        int ni=0;
        for(ni=0;ni<paginas;ni++)
             {
                 this.imprimir(ni, paginas, this.tf_foliodistribucion.getText());
             }
    }//GEN-LAST:event_jmni_imprimirActionPerformed

    private void jmni_distribucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_distribucionActionPerformed
        try {
            // TODO add your handling code here:
            this.jtbl_distribucion.print();
        } catch (PrinterException ex) {
            Logger.getLogger(com_distri_compras_detalle.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmni_distribucionActionPerformed

    private void jmni_foliotiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_foliotiendasActionPerformed

        this.imprimir_detalle(0, 1,"0");
    }//GEN-LAST:event_jmni_foliotiendasActionPerformed

    private void jbtn_actualizar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizar1ActionPerformed
        // TODO add your handling code here:
        if(Integer.valueOf(this.tf_foliotienda.getText().toString())==0) {
            JOptionPane.showMessageDialog(null,"Error Verifiqu su folio a Corregir", "Sistema Integral Error",1);
        }
        else
        {
         if(JOptionPane.showConfirmDialog(null, "Estan Correctos los Datos?")==0)
         {
            int folio=0;
            String textosql="select * from x1distribucion_terminados_entra_doctos_update(4,'"+this.tf_foliodistribucion.getText()+"','"+this.tf_foliotienda.getText().toUpperCase().trim()+"','"+this.tf_foliotienda1.getText().toUpperCase().trim()+"');";
            try {
                rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
                while (rs.next()) {
                    folio = rs.getInt(1);
                }
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
            if (folio==1) {
             JOptionPane.showMessageDialog(null,"Gracias Observacion Actualizada correctamente", "Sistema Integral: Entrada",1);
            } else {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
            }
        }
        }
    }//GEN-LAST:event_jbtn_actualizar1ActionPerformed

    private void jtf_fleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fleteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_fleteActionPerformed

    private void jtf_costodifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_costodifActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_costodifActionPerformed

    private void jtf_costodif1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_costodif1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_costodif1ActionPerformed

    private void jmni_documentodifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_documentodifActionPerformed
        // TODO add your handling code here:
        float filas = this.jtable_modelo_detalled.getRowCount() ;
        float paginas = filas /50;
        int ni=0;
        for(ni=0;ni<paginas;ni++)
             {
                 this.imprimirdif(ni, paginas, this.tf_foliodistribucion.getText());
             }
    }//GEN-LAST:event_jmni_documentodifActionPerformed

    private void jbtn_imprimirdetalleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imprimirdetalleActionPerformed
        // TODO add your handling code here:
        this.imprimir_detalle(0, 1,"0");
}//GEN-LAST:event_jbtn_imprimirdetalleActionPerformed

    private void jbtn_generarventa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generarventa2ActionPerformed
        // TODO add your handling code here:

if((this.jtable_modelo.getRowCount()==1) && (Integer.valueOf(this.jtf_idcliente1.getText().toString())>0))
{
        if(JOptionPane.showConfirmDialog(null,"<html><h2>Proveedor:"+this.jtf_idproveedor.getText()+"<br>Desea Generar Venta? Para Cliente:<br>"+this.jtf_idcliente1.getText()+":"+this.jtf_describecliente1.getText()+" con<br>Total pieza="+this.jtf_totalpiezas1.getText()+"<br>Importe Costo Proveedor:$"+this.jtf_doctototal1.getText()+"<br> Importe Costo Integrado:$"+this.jtf_doctototalpd1.getText()+"</html>")==0)
            {
                String idprov[]=this.jtf_idproveedor.getText().toString().split(":");
                String idcla[]=this.jtf_viaje.getText().toString().split(":");

                int retorno=0;
                String texto="select * from x1distribucion_terminados_ventas_agregar_compracompletav3(1,'"+this.tf_foliodistribucion.getText()+"','1','"+this.jtf_idcliente1.getText()+"','"+idprov[0]+"','"+idcla[0]+"','"+this.tf_foliodoctoanterior.getText()+"','"+this.fechaamericana(this.tf_fechareferencia.getText())+"');";
                System.out.println(texto);
                try
                   {
                   rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                   while (rs.next())
                       {
                           retorno=rs.getInt(1);
                       }
                   }
                    catch(Exception e)
                        {
                            System.out.println(e.getMessage());
                        }
                    if (retorno>0)
                        {
                            this.jbtn_generarventa.setVisible(false);
                            //jtable_modelo.setValueAt(retorno,Integer.valueOf(this.jtf_idffila.getText()) ,0);
                            JOptionPane.showMessageDialog(null," Folio "+retorno+" Correcto", "Sistema Integral(Venta Alta) : Error",1);
                            this.carga_datos(7,this.tf_foliodistribucion.getText().trim());
                        }
                this.jbtn_generarventa2.setVisible(false);
        }
}
else
    {
        JOptionPane.showMessageDialog(null," Elija un Cliente o verifique que su Compra aun no este Asignada!!", "Sistema Integral(Venta Alta) : Error",1);
    }
    }//GEN-LAST:event_jbtn_generarventa2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.jmni_imprimirActionPerformed(evt);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        int fo=Integer.valueOf(this.tf_foliodistribucion.getText())+1;
         this.carga_datos_encabezado(10, String.valueOf(fo));
        this.carga_datos_detalle(String.valueOf(fo));
        yacarguedistrialma=0;
        yacarguedistrifotos=0;
        yacarguedistrirecepciones=0;
        yacarguestock=0;
        if(indexactual==3)
            {
               yacarguedistrirecepciones=1;
               this.carga_datos(7,this.tf_foliodistribucion.getText().trim());
            }
        this.jbtn_generarventa2.setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void tf_foliodoctoanteriorupda1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliodoctoanteriorupda1ActionPerformed
        // TODO add your handling code here:
        this.jbtn_actualizar2ActionPerformed(evt);
    }//GEN-LAST:event_tf_foliodoctoanteriorupda1ActionPerformed

    private void jbtn_actualizar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizar2ActionPerformed
        // TODO add your handling code here:
        if(this.tf_foliodoctoanteriorupda1.getText().length()>0)
        {
             if(JOptionPane.showConfirmDialog(null, "Desea actualizar Proveedor?")==0)
                {
                int folio=0;
                String textosql="select * from x1distribucion_terminados_entra_doctos_update(3,'"+this.tf_foliodistribucion.getText()+"','"+this.tf_foliodoctoanteriorupda1.getText().toUpperCase().trim()+"','');";
                try {
                    rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
                    while (rs.next()) {
                        folio = rs.getInt(1);
                    }
                } catch (Exception e) {
                    System.out.println(e.getMessage());
                }
                if (folio==1)
                    {
                    this.jtf_idproveedor.setText(this.tf_foliodoctoanteriorupda1.getText().toUpperCase().trim());
                    JOptionPane.showMessageDialog(null,"Gracias Proveedor Actualizado correctamente", "Sistema Integral: Entrada",1);
                    }
                else
                    {
                    JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
                    }
            }
        }
        else
            {
                JOptionPane.showMessageDialog(null,"Error Verifiqu con Administrador no se ha podido guardar", "Sistema Integral Error",1);
            }   
    }//GEN-LAST:event_jbtn_actualizar2ActionPerformed

    private void tf_foliotiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliotiendaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_foliotiendaActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:

        this.jbtn_actualizar1.setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void tf_foliotienda1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_foliotienda1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tf_foliotienda1ActionPerformed

    private void jtf_doctoblisterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_doctoblisterActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_doctoblisterActionPerformed
    private void jlst_clientesdistribucionMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jt_detallecompraMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtbl_distribucionMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtbl_distribucionfotosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtbl_recepcionesMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtb_catalogo_artiexisMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void find_textoenjtable(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_detalle.getRowCount()-3,i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_detalle.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jt_detallecompra.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado.setText("Resultado:"+this.jtf_buscarenjtable.getText()+"="+coincidencias);
    }
private void find_textoenjtable3(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_fotos.getRowCount()-3,i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_fotos.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtbl_distribucionfotos.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado2.setText("Resultado:"+this.jtf_buscarenjtable2.getText()+"="+coincidencias);
    }
private void find_textoenjtable2(int columna,int filainicio,String texto)
    {
       int totalfilasreporte=this.jtable_modelo_distribucion.getRowCount()-3,i=0,encontro=0,coincidencias=0;
       String cadenaobtenida="";
         //genero los totales por tienda
       for(i=0;i<totalfilasreporte;i++)
            {
                cadenaobtenida=jtable_modelo_distribucion.getValueAt(i, columna).toString();
                encontro=cadenaobtenida.indexOf(texto);
                if(encontro!=-1)
                    {
                        System.out.println(cadenaobtenida+" en pocicion "+i);
                        this.jtbl_distribucion.changeSelection(i, 0, true, false);
                        encontro=-1;
                        coincidencias++;
                    }
            }
            this.jlb_resultado1.setText("Resultado:"+this.jtf_buscarenjtable1.getText()+"="+coincidencias);
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new com_distri_compras_detalle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_actualizar;
    private javax.swing.JButton jbtn_actualizar1;
    private javax.swing.JButton jbtn_actualizar2;
    private javax.swing.JButton jbtn_cargardistribucionxclie;
    private javax.swing.JButton jbtn_generarventa;
    private javax.swing.JButton jbtn_generarventa1;
    private javax.swing.JButton jbtn_generarventa2;
    private javax.swing.JButton jbtn_imagenfull;
    private javax.swing.JButton jbtn_imprimirdetalle;
    private javax.swing.JButton jbtn_provestadistica;
    private javax.swing.JCheckBox jchk_graficadistribucion;
    private javax.swing.JEditorPane jep_articuloimagen;
    private javax.swing.JTextField jep_observaciones;
    private javax.swing.JLabel jlb_resultado;
    private javax.swing.JLabel jlb_resultado1;
    private javax.swing.JLabel jlb_resultado2;
    private javax.swing.JList jlst_clientesdistribucion;
    private javax.swing.JMenuItem jmni_distribucion;
    private javax.swing.JMenuItem jmni_documentodif;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_foliotiendas;
    private javax.swing.JMenuItem jmni_imprimir;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrbtn_columnaclave;
    private javax.swing.JRadioButton jrbtn_columnaclave1;
    private javax.swing.JRadioButton jrbtn_columnaclave2;
    private javax.swing.JRadioButton jrbtn_item;
    private javax.swing.JRadioButton jrbtn_item1;
    private javax.swing.JRadioButton jrbtn_item2;
    private javax.swing.JTable jt_detallecompra;
    private javax.swing.JTable jt_detallecompra1;
    private javax.swing.JTable jt_detallecomprasae;
    private javax.swing.JTable jtb_catalogo_artiexis;
    private javax.swing.JTable jtbl_distribucion;
    private javax.swing.JTable jtbl_distribucionfotos;
    private javax.swing.JTable jtbl_estadisticasarticulo1;
    private javax.swing.JTable jtbl_recepciones;
    private javax.swing.JTextField jtf_buscarenjtable;
    private javax.swing.JTextField jtf_buscarenjtable1;
    private javax.swing.JTextField jtf_buscarenjtable2;
    private javax.swing.JTextField jtf_costodif;
    private javax.swing.JTextField jtf_costodif1;
    private javax.swing.JTextField jtf_describecliente;
    private javax.swing.JTextField jtf_describecliente1;
    private javax.swing.JTextField jtf_doctoblister;
    private javax.swing.JTextField jtf_doctodesc;
    private javax.swing.JTextField jtf_doctodesc1;
    private javax.swing.JTextField jtf_doctodesc2;
    private javax.swing.JTextField jtf_doctoimp;
    private javax.swing.JTextField jtf_doctoimp1;
    private javax.swing.JTextField jtf_doctoimp2;
    private javax.swing.JTextField jtf_doctosubtotal;
    private javax.swing.JTextField jtf_doctosubtotal1;
    private javax.swing.JTextField jtf_doctosubtotal2;
    private javax.swing.JTextField jtf_doctototal;
    private javax.swing.JTextField jtf_doctototal1;
    private javax.swing.JTextField jtf_doctototal2;
    private javax.swing.JTextField jtf_doctototal3;
    private javax.swing.JTextField jtf_doctototalpd;
    private javax.swing.JTextField jtf_doctototalpd1;
    private javax.swing.JTextField jtf_flete;
    private javax.swing.JTextField jtf_fotoidstocks2;
    private javax.swing.JTextField jtf_idarticulo_fotostock;
    private javax.swing.JTextField jtf_idcliente;
    private javax.swing.JTextField jtf_idcliente1;
    private javax.swing.JTextField jtf_idffila;
    private javax.swing.JTextField jtf_idproveedor;
    private javax.swing.JTextField jtf_importeprecio;
    private javax.swing.JTextField jtf_observa_update;
    private javax.swing.JTextField jtf_pzasdistri;
    private javax.swing.JTextField jtf_pzasdistri1;
    private javax.swing.JTextField jtf_totalletras;
    private javax.swing.JTextField jtf_totalpiezas;
    private javax.swing.JTextField jtf_totalpiezas1;
    private javax.swing.JTextField jtf_totalpiezas2;
    private javax.swing.JTextField jtf_totalpiezasdif;
    private javax.swing.JTextField jtf_viaje;
    private javax.swing.JTextField tf_fecha;
    private javax.swing.JTextField tf_fecharecepcion;
    private javax.swing.JTextField tf_fechareferencia;
    private javax.swing.JTextField tf_foliodistribucion;
    private javax.swing.JTextField tf_foliodoctoanterior;
    private javax.swing.JTextField tf_foliodoctoanteriorupda;
    private javax.swing.JTextField tf_foliodoctoanteriorupda1;
    private javax.swing.JTextField tf_foliotienda;
    private javax.swing.JTextField tf_foliotienda1;
    private javax.swing.JTextField tf_status;
    // End of variables declaration//GEN-END:variables
private com_distri_folios_imprimir objimpresora;
}
